Class BinaryKeysetReader

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method 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​(java.io.File file)
      Deprecated.
      Inline the function.
      static KeysetReader withInputStream​(java.io.InputStream stream)
      Static method to create a BinaryKeysetReader from an InputStream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • withInputStream

        public static KeysetReader withInputStream​(java.io.InputStream stream)
        Static method to create a BinaryKeysetReader from an 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.

      • 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.IOException
        Deprecated.
        Inline the function.
        Static method to create a BinaryKeysetReader from a file.

        Note: the input file won't be read until read() or readEncrypted() is called.

        Throws:
        java.io.IOException
      • read

        public com.google.crypto.tink.proto.Keyset read()
                                                 throws java.io.IOException
        Description copied from interface: KeysetReader
        Tries to read and return a cleartext Keyset.
        Specified by:
        read in interface KeysetReader
        Returns:
        the Keyset
        Throws:
        java.io.IOException
      • readEncrypted

        public com.google.crypto.tink.proto.EncryptedKeyset readEncrypted()
                                                                   throws java.io.IOException
        Description copied from interface: KeysetReader
        Tries to read and return an EncryptedKeyset.
        Specified by:
        readEncrypted in interface KeysetReader
        Returns:
        the EncryptedKeyset
        Throws:
        java.io.IOException