public final class BinaryKeysetReader extends Object implements KeysetReader
KeysetReader that can read from some source cleartext or encrypted keysets in proto binary wire format.| Modifier and Type | Method and Description |
|---|---|
com.google.crypto.tink.proto.Keyset |
read()
Tries to read and return a cleartext
Keyset. |
com.google.crypto.tink.proto.EncryptedKeyset |
readEncrypted()
Tries to read and return an
EncryptedKeyset. |
static KeysetReader |
withBytes(byte[] bytes)
Static method to create a BinaryKeysetReader from a byte arrary.
|
static KeysetReader |
withFile(File file)
Static method to create a BinaryKeysetReader from a file.
|
static KeysetReader |
withInputStream(InputStream stream)
Static method to create a BinaryKeysetReader from an
InputStream. |
public static KeysetReader withInputStream(InputStream stream)
InputStream.
Note: the input stream won't be read until read() or readEncrypted() is called.
public static KeysetReader withBytes(byte[] bytes)
public static KeysetReader withFile(File file) throws IOException
Note: the input file won't be read until read() or readEncrypted() is called.
IOExceptionpublic com.google.crypto.tink.proto.Keyset read()
throws IOException
KeysetReaderKeyset.read in interface KeysetReaderIOExceptionpublic com.google.crypto.tink.proto.EncryptedKeyset readEncrypted()
throws IOException
KeysetReaderEncryptedKeyset.readEncrypted in interface KeysetReaderIOException