public final class JsonKeysetReader extends Object implements KeysetReader
KeysetReader that can read from source source cleartext or encrypted keysets in proto
JSON 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 JsonKeysetReader |
withBytes(byte[] bytes)
Static method to create a JsonKeysetReader from a byte array.
|
static JsonKeysetReader |
withFile(File file)
Deprecated.
Method should be inlined.
|
static JsonKeysetReader |
withInputStream(InputStream input)
Static method to create a JsonKeysetReader from an
InputStream. |
static JsonKeysetReader |
withJsonObject(Object input)
Deprecated.
Use
#withString |
static JsonKeysetReader |
withPath(Path path)
Deprecated.
Method should be inlined.
|
static JsonKeysetReader |
withPath(String path)
Deprecated.
Method should be inlined.
|
static JsonKeysetReader |
withString(String input)
Static method to create a JsonKeysetReader from a string.
|
JsonKeysetReader |
withUrlSafeBase64() |
public static JsonKeysetReader withInputStream(InputStream input) throws IOException
InputStream.
Note: the input stream won't be read until read() or readEncrypted() is called.
IOException@InlineMe(replacement="JsonKeysetReader.withString(input.toString())",
imports="com.google.crypto.tink.JsonKeysetReader")
@Deprecated
public static JsonKeysetReader withJsonObject(Object input)
#withStringJsonObject.public static JsonKeysetReader withString(String input)
public static JsonKeysetReader withBytes(byte[] bytes)
@InlineMe(replacement="JsonKeysetReader.withInputStream(new FileInputStream(file))",
imports={"com.google.crypto.tink.JsonKeysetReader","java.io.FileInputStream"})
@Deprecated
public static JsonKeysetReader withFile(File file)
throws IOException
Note: the file won't be read until read() or readEncrypted() is called.
IOException@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(String path)
throws IOException
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.
IOException@InlineMe(replacement="JsonKeysetReader.withInputStream(new FileInputStream(path.toFile()))",
imports={"com.google.crypto.tink.JsonKeysetReader","java.io.FileInputStream"})
@RequiresApi(value=26)
@Deprecated
public static JsonKeysetReader withPath(Path path)
throws IOException
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.
IOException@CanIgnoreReturnValue public JsonKeysetReader withUrlSafeBase64()
public Keyset read() throws IOException
KeysetReaderKeyset.read in interface KeysetReaderIOExceptionpublic EncryptedKeyset readEncrypted() throws IOException
KeysetReaderEncryptedKeyset.readEncrypted in interface KeysetReaderIOException