public final class SharedPrefKeysetReader extends Object implements KeysetReader
KeysetReader that can read keysets from private shared preferences on Android.| Constructor and Description |
|---|
SharedPrefKeysetReader(Context context,
String keysetName,
String prefFilename)
Creates a
KeysetReader that reads and hex-decodes keysets from the preference
name keysetName in the private shared preferences file prefFilename. |
| Modifier and Type | Method and 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. |
public SharedPrefKeysetReader(Context context, String keysetName, String prefFilename) throws IOException
KeysetReader that reads and hex-decodes keysets from the preference
name keysetName in the private shared preferences file prefFilename.
If prefFilename is null, uses the default shared preferences file.
IOException - if cannot read the keysetIllegalArgumentException - if keysetName is nullpublic com.google.crypto.tink.proto.Keyset read()
throws IOException
KeysetReaderKeyset.read in interface KeysetReaderIOExceptionpublic com.google.crypto.tink.proto.EncryptedKeyset readEncrypted()
throws IOException
KeysetReaderEncryptedKeyset.readEncrypted in interface KeysetReaderIOException