Class StreamingAeadWrapper
- java.lang.Object
-
- com.google.crypto.tink.streamingaead.StreamingAeadWrapper
-
- All Implemented Interfaces:
PrimitiveWrapper<StreamingAead,StreamingAead>
public class StreamingAeadWrapper extends java.lang.Object implements PrimitiveWrapper<StreamingAead,StreamingAead>
StreamingAeadWrapper is the implementation of PrimitiveWrapper for the StreamingAead primitive.The returned primitive works with a keyset (rather than a single key). To encrypt a plaintext, it uses the primary key in the keyset. To decrypt, the primitive tries the enabled keys from the keyset to select the right key for decryption. All keys in a keyset of StreamingAead have type
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<StreamingAead>getInputPrimitiveClass()Returns the primitive class object of the primitive used to create B.java.lang.Class<StreamingAead>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 ofStreamingAeadWrapperto the providedPrimitiveRegistry.Builder.StreamingAeadwrap(KeysetHandleInterface handle, MonitoringAnnotations annotations, PrimitiveWrapper.PrimitiveFactory<StreamingAead> factory)Wraps aPrimitiveSetand returns a single instance.
-
-
-
Method Detail
-
wrap
public StreamingAead wrap(KeysetHandleInterface handle, MonitoringAnnotations annotations, PrimitiveWrapper.PrimitiveFactory<StreamingAead> 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<StreamingAead,StreamingAead>- Throws:
java.security.GeneralSecurityException
-
getPrimitiveClass
public java.lang.Class<StreamingAead> 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<StreamingAead,StreamingAead>
-
getInputPrimitiveClass
public java.lang.Class<StreamingAead> 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<StreamingAead,StreamingAead>
-
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 ofStreamingAeadWrapperto the providedPrimitiveRegistry.Builder.- Throws:
java.security.GeneralSecurityException
-
-