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)
Static method to create a JsonKeysetWriter that writes to a file.
|
static KeysetWriter |
withOutputStream(OutputStream stream)
Static method to create a JsonKeysetWriter that writes to an
OutputStream. |
static KeysetWriter |
withPath(Path path)
Static method to create a JsonKeysetWriter that writes to a file path.
|
static KeysetWriter |
withPath(String path)
Static method to create a JsonKeysetWriter that writes to a file path.
|
void |
write(com.google.crypto.tink.proto.EncryptedKeyset keyset)
Tries to write an
EncryptedKeyset to some storage system. |
void |
write(com.google.crypto.tink.proto.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.
public static KeysetWriter withFile(File file) throws IOException
IOExceptionpublic static KeysetWriter withPath(String path) throws IOException
IOExceptionpublic static KeysetWriter withPath(Path path) throws IOException
This method only works on Android API level 26 or newer.
IOExceptionpublic void write(com.google.crypto.tink.proto.Keyset keyset)
throws IOException
KeysetWriterKeyset to some storage system.write in interface KeysetWriterIOExceptionpublic void write(com.google.crypto.tink.proto.EncryptedKeyset keyset)
throws IOException
KeysetWriterEncryptedKeyset to some storage system.write in interface KeysetWriterIOException