public final class JsonKeysetWriter extends Object implements KeysetWriter
KeysetWriter that can write to some source cleartext or encrypted keysets in proto
JSON format.| Modifier and Type | Method and Description |
|---|---|
static KeysetWriter |
withFile(File file)
Deprecated.
Method should be inlined.
|
static KeysetWriter |
withOutputStream(OutputStream stream)
Static method to create a JsonKeysetWriter that writes to an
OutputStream. |
static KeysetWriter |
withPath(Path path)
Deprecated.
Method should be inlined.
|
static KeysetWriter |
withPath(String path)
Deprecated.
Method should be inlined.
|
void |
write(EncryptedKeyset keyset)
Tries to write an
EncryptedKeyset to some storage system. |
void |
write(Keyset keyset)
Tries to write a
Keyset to some storage system. |
public static KeysetWriter withOutputStream(OutputStream stream)
OutputStream.
stream will be closed after the keyset is written.
@InlineMe(replacement="JsonKeysetWriter.withOutputStream(new FileOutputStream(file))",
imports={"com.google.crypto.tink.JsonKeysetWriter","java.io.FileOutputStream"})
@Deprecated
public static KeysetWriter withFile(File file)
throws IOException
IOException@InlineMe(replacement="JsonKeysetWriter.withOutputStream(new FileOutputStream(new File(path)))",
imports={"com.google.crypto.tink.JsonKeysetWriter","java.io.File","java.io.FileOutputStream"})
@Deprecated
public static KeysetWriter withPath(String path)
throws IOException
IOException@RequiresApi(value=26)
@InlineMe(replacement="JsonKeysetWriter.withOutputStream(new FileOutputStream(path.toFile()))",
imports={"com.google.crypto.tink.JsonKeysetWriter","java.io.FileOutputStream"})
@Deprecated
public static KeysetWriter withPath(Path path)
throws IOException
This method only works on Android API level 26 or newer.
IOExceptionpublic void write(Keyset keyset) throws IOException
KeysetWriterKeyset to some storage system.write in interface KeysetWriterIOExceptionpublic void write(EncryptedKeyset keyset) throws IOException
KeysetWriterEncryptedKeyset to some storage system.write in interface KeysetWriterIOException