Package com.google.crypto.tink
Class BinaryKeysetReader
- java.lang.Object
-
- com.google.crypto.tink.BinaryKeysetReader
-
- All Implemented Interfaces:
KeysetReader
public final class BinaryKeysetReader extends java.lang.Object implements KeysetReader
AKeysetReaderthat can read from some source cleartext or encrypted keysets in proto binary wire format.- Since:
- 1.0.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description com.google.crypto.tink.proto.Keysetread()Tries to read and return a cleartextKeyset.com.google.crypto.tink.proto.EncryptedKeysetreadEncrypted()Tries to read and return anEncryptedKeyset.static KeysetReaderwithBytes(byte[] bytes)Static method to create a BinaryKeysetReader from a byte arrary.static KeysetReaderwithFile(java.io.File file)Deprecated.Inline the function.static KeysetReaderwithInputStream(java.io.InputStream stream)Static method to create a BinaryKeysetReader from anInputStream.
-
-
-
Method Detail
-
withInputStream
public static KeysetReader withInputStream(java.io.InputStream stream)
Static method to create a BinaryKeysetReader from anInputStream.Note: the input stream won't be read until
read()orreadEncrypted()is called, and will be closed immediately after the keyset is read.
-
withBytes
public static KeysetReader withBytes(byte[] bytes)
Static method to create a BinaryKeysetReader from a byte arrary.
-
withFile
@InlineMe(replacement="BinaryKeysetReader.withInputStream(new FileInputStream(file))", imports={"com.google.crypto.tink.BinaryKeysetReader","java.io.FileInputStream"}) @Deprecated public static KeysetReader withFile(java.io.File file) throws java.io.IOExceptionDeprecated.Inline the function.Static method to create a BinaryKeysetReader from a file.Note: the input file won't be read until
read()orreadEncrypted()is called.- Throws:
java.io.IOException
-
read
public com.google.crypto.tink.proto.Keyset read() throws java.io.IOExceptionDescription copied from interface:KeysetReaderTries to read and return a cleartextKeyset.- Specified by:
readin interfaceKeysetReader- Returns:
- the Keyset
- Throws:
java.io.IOException
-
readEncrypted
public com.google.crypto.tink.proto.EncryptedKeyset readEncrypted() throws java.io.IOExceptionDescription copied from interface:KeysetReaderTries to read and return anEncryptedKeyset.- Specified by:
readEncryptedin interfaceKeysetReader- Returns:
- the EncryptedKeyset
- Throws:
java.io.IOException
-
-