Package com.google.crypto.tink
Class CleartextKeysetHandle
- java.lang.Object
-
- com.google.crypto.tink.CleartextKeysetHandle
-
public final class CleartextKeysetHandle extends java.lang.ObjectStatic methods for reading or writing cleartext keysets.WARNING
Reading or writing cleartext keysets is a bad practice, usage of this API should be restricted. Users can read encrypted keysets using
KeysetHandle.read(com.google.crypto.tink.KeysetReader, com.google.crypto.tink.Aead).- Since:
- 1.0.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static KeysetHandlefromKeyset(com.google.crypto.tink.proto.Keyset keyset)Deprecated.Instead, use aKeysetHandle.Builder.static com.google.crypto.tink.proto.KeysetgetKeyset(KeysetHandle keysetHandle)Deprecated.Instead, call "KeysetHandle.getAt()" to get information about individual keys or TinkProtoKeysetFormat if you need a serialized keyset.static KeysetHandleparseFrom(byte[] serialized)Deprecated.CallTinkProtoKeysetFormat.parseKeyset(serialized, InsecureSecretKeyAccess.get())which has the same semantics.static KeysetHandleread(KeysetReader reader)static KeysetHandleread(KeysetReader reader, java.util.Map<java.lang.String,java.lang.String> monitoringAnnotations)Deprecated.Instead, use aKeysetHandle.Builder.static voidwrite(KeysetHandle handle, KeysetWriter keysetWriter)Serializes and writes theKeysetmanaged byhandletokeysetWriter.
-
-
-
Method Detail
-
parseFrom
@Deprecated public static final KeysetHandle parseFrom(byte[] serialized) throws java.security.GeneralSecurityException
Deprecated.CallTinkProtoKeysetFormat.parseKeyset(serialized, InsecureSecretKeyAccess.get())which has the same semantics.- Returns:
- a new
KeysetHandlefromserializedthat is a serializedKeyset - Throws:
java.security.GeneralSecurityException
-
read
public static KeysetHandle read(KeysetReader reader) throws java.security.GeneralSecurityException, java.io.IOException
- Returns:
- a new
KeysetHandlefrom aKeysetread withreader. - Throws:
java.security.GeneralSecurityException- when the keyset is invalid or can't be read.java.io.IOException
-
read
@Deprecated public static KeysetHandle read(KeysetReader reader, java.util.Map<java.lang.String,java.lang.String> monitoringAnnotations) throws java.security.GeneralSecurityException, java.io.IOException
Deprecated.Instead, use aKeysetHandle.Builder.Creates aKeysetHandlefrom aKeysetReader.The additional
monitoringAnnotationsare used for monitoring, and will be passed to theMonitoringClient.- Throws:
java.security.GeneralSecurityException- when the keyset is invalid or cannot be read.java.io.IOException
-
getKeyset
@Deprecated public static com.google.crypto.tink.proto.Keyset getKeyset(KeysetHandle keysetHandle)
Deprecated.Instead, call "KeysetHandle.getAt()" to get information about individual keys or TinkProtoKeysetFormat if you need a serialized keyset.- Returns:
- the keyset underlying this
keysetHandle.
-
fromKeyset
@Deprecated public static KeysetHandle fromKeyset(com.google.crypto.tink.proto.Keyset keyset) throws java.security.GeneralSecurityException
Deprecated.Instead, use aKeysetHandle.Builder.Returns a KeysetHandle forkeyset.- Throws:
java.security.GeneralSecurityException
-
write
public static void write(KeysetHandle handle, KeysetWriter keysetWriter) throws java.io.IOException
Serializes and writes theKeysetmanaged byhandletokeysetWriter.- Throws:
java.io.IOException
-
-