Class JsonKeysetReader

    • Method Detail

      • withInputStream

        public static JsonKeysetReader withInputStream​(java.io.InputStream input)
                                                throws java.io.IOException
        Static method to create a JsonKeysetReader from an InputStream.

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

        Throws:
        java.io.IOException
      • withJsonObject

        @InlineMe(replacement="JsonKeysetReader.withString(input.toString())",
                  imports="com.google.crypto.tink.JsonKeysetReader")
        @Deprecated
        public static JsonKeysetReader withJsonObject​(java.lang.Object input)
        Deprecated.
        Use #withString
        Static method to create a JsonKeysetReader from an JsonObject.
      • withString

        public static JsonKeysetReader withString​(java.lang.String input)
        Static method to create a JsonKeysetReader from a string.
      • withBytes

        @Deprecated
        public static JsonKeysetReader withBytes​(byte[] bytes)
        Deprecated.
        Use TinkJsonProtoKeysetFormat.parseKeyset() instead.
        Static method to create a JsonKeysetReader from a byte array.
      • withFile

        @InlineMe(replacement="JsonKeysetReader.withInputStream(new FileInputStream(file))",
                  imports={"com.google.crypto.tink.JsonKeysetReader","java.io.FileInputStream"})
        @Deprecated
        public static JsonKeysetReader withFile​(java.io.File file)
                                         throws java.io.IOException
        Deprecated.
        Method should be inlined.
        Static method to create a JsonKeysetReader from a file.

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

        Throws:
        java.io.IOException
      • withPath

        @InlineMe(replacement="JsonKeysetReader.withInputStream(new FileInputStream(new File(path)))",
                  imports={"com.google.crypto.tink.JsonKeysetReader","java.io.File","java.io.FileInputStream"})
        @Deprecated
        public static JsonKeysetReader withPath​(java.lang.String path)
                                         throws java.io.IOException
        Deprecated.
        Method should be inlined.
        Static method to create a JsonKeysetReader from a Path.

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

        This method only works on Android API level 26 or newer.

        Throws:
        java.io.IOException
      • withPath

        @InlineMe(replacement="JsonKeysetReader.withInputStream(new FileInputStream(path.toFile()))",
                  imports={"com.google.crypto.tink.JsonKeysetReader","java.io.FileInputStream"})
        @Deprecated
        public static JsonKeysetReader withPath​(java.nio.file.Path path)
                                         throws java.io.IOException
        Deprecated.
        Method should be inlined.
        Static method to create a JsonKeysetReader from a Path.

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

        This method only works on Android API level 26 or newer.

        Throws:
        java.io.IOException
      • withUrlSafeBase64

        @CanIgnoreReturnValue
        public JsonKeysetReader withUrlSafeBase64()
      • 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