Package com.google.crypto.tink.daead
Class DeterministicAeadWrapper
- java.lang.Object
-
- com.google.crypto.tink.daead.DeterministicAeadWrapper
-
- All Implemented Interfaces:
PrimitiveWrapper<DeterministicAead,DeterministicAead>
public class DeterministicAeadWrapper extends java.lang.Object implements PrimitiveWrapper<DeterministicAead,DeterministicAead>
The implementation ofPrimitiveWrapper<DeterministicAead>.The created primitive works with a keyset (rather than a single key). To encrypt a plaintext, it uses the primary key in the keyset, and prepends to the ciphertext a certain prefix associated with the primary key. To decrypt, the primitive uses the prefix of the ciphertext to efficiently select the right key in the set. If the keys associated with the prefix do not work, the primitive tries all keys with
OutputPrefixType.RAW.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.crypto.tink.internal.PrimitiveWrapper
PrimitiveWrapper.PrimitiveFactory<B>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<DeterministicAead>getInputPrimitiveClass()Returns the primitive class object of the primitive used to create B.java.lang.Class<DeterministicAead>getPrimitiveClass()Returns the primitive class object of the primitive managed.static voidregister()static voidregisterToInternalPrimitiveRegistry(PrimitiveRegistry.Builder primitiveRegistryBuilder)registerToInternalPrimitiveRegistry is a non-public method (it takes an argument of an internal-only type) registering an instance ofDeterministicAeadWrapperto the providedPrimitiveRegistry.Builder.DeterministicAeadwrap(KeysetHandleInterface handle, MonitoringAnnotations annotations, PrimitiveWrapper.PrimitiveFactory<DeterministicAead> factory)Wraps aPrimitiveSetand returns a single instance.
-
-
-
Method Detail
-
wrap
public DeterministicAead wrap(KeysetHandleInterface handle, MonitoringAnnotations annotations, PrimitiveWrapper.PrimitiveFactory<DeterministicAead> factory) throws java.security.GeneralSecurityException
Description copied from interface:PrimitiveWrapperWraps aPrimitiveSetand returns a single instance.This method gets called when a new primitive is created.
- Specified by:
wrapin interfacePrimitiveWrapper<DeterministicAead,DeterministicAead>- Throws:
java.security.GeneralSecurityException
-
getPrimitiveClass
public java.lang.Class<DeterministicAead> getPrimitiveClass()
Description copied from interface:PrimitiveWrapperReturns the primitive class object of the primitive managed. Used for internal management. Should be implemented asreturn P.class;when implementing a wrapper creating objects of typeP.- Specified by:
getPrimitiveClassin interfacePrimitiveWrapper<DeterministicAead,DeterministicAead>
-
getInputPrimitiveClass
public java.lang.Class<DeterministicAead> getInputPrimitiveClass()
Description copied from interface:PrimitiveWrapperReturns the primitive class object of the primitive used to create B. Used for internal management. Should be implemented asreturn B.class;.- Specified by:
getInputPrimitiveClassin interfacePrimitiveWrapper<DeterministicAead,DeterministicAead>
-
register
public static void register() throws java.security.GeneralSecurityException- Throws:
java.security.GeneralSecurityException
-
registerToInternalPrimitiveRegistry
public static void registerToInternalPrimitiveRegistry(PrimitiveRegistry.Builder primitiveRegistryBuilder) throws java.security.GeneralSecurityException
registerToInternalPrimitiveRegistry is a non-public method (it takes an argument of an internal-only type) registering an instance ofDeterministicAeadWrapperto the providedPrimitiveRegistry.Builder.- Throws:
java.security.GeneralSecurityException
-
-