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 |
|---|---|
Keyset |
read()
Tries to read and return a cleartext
Keyset. |
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)
Deprecated.
|
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, and will be closed immediately after the keyset is
read.
public static KeysetReader withBytes(byte[] bytes)
@InlineMe(replacement="BinaryKeysetReader.withInputStream(new FileInputStream(file))",
imports={"com.google.crypto.tink.BinaryKeysetReader","java.io.FileInputStream"})
@Deprecated
public static KeysetReader withFile(File file)
throws IOException
Note: the input file won't be read until read() or readEncrypted() is called.
IOExceptionpublic Keyset read() throws IOException
KeysetReaderKeyset.read in interface KeysetReaderIOExceptionpublic EncryptedKeyset readEncrypted() throws IOException
KeysetReaderEncryptedKeyset.readEncrypted in interface KeysetReaderIOException