Package com.google.crypto.tink.internal
Interface PrimitiveWrapper<B,P>
-
- All Known Implementing Classes:
AeadWrapper,ChunkedMacWrapper,DeterministicAeadWrapper,HybridDecryptWrapper,HybridEncryptWrapper,KeysetDeriverWrapper,MacWrapper,PrfSetWrapper,PublicKeySignWrapper,PublicKeyVerifyWrapper,StreamingAeadWrapper
public interface PrimitiveWrapper<B,P>Basic interface for wrapping a primitive.A PrimitiveSet can be wrapped by a single primitive in order to fulfil a cryptographic task. This is done by the PrimitiveWrapper. Whenever a new primitive type is added to Tink, the user should define a new PrimitiveWrapper and register it by calling
com.google.crypto.tink.Registry#registerPrimitiveWrapper.The primitive wrapper wraps primitives of type
Binto primitives of typeP. Often, these are the same classes, but in some cases they may not be. There can only be one wrapper for each result primitiveP(as Tink needs to know how to generate aP), but there may be many wrapping the sameB.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfacePrimitiveWrapper.PrimitiveFactory<B>Creates a primitive from an entry.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Class<B>getInputPrimitiveClass()Returns the primitive class object of the primitive used to create B.java.lang.Class<P>getPrimitiveClass()Returns the primitive class object of the primitive managed.Pwrap(KeysetHandleInterface keysetHandle, MonitoringAnnotations annotations, PrimitiveWrapper.PrimitiveFactory<B> primitiveFactory)Wraps aPrimitiveSetand returns a single instance.
-
-
-
Method Detail
-
wrap
P wrap(KeysetHandleInterface keysetHandle, MonitoringAnnotations annotations, PrimitiveWrapper.PrimitiveFactory<B> primitiveFactory) throws java.security.GeneralSecurityException
Wraps aPrimitiveSetand returns a single instance.This method gets called when a new primitive is created.
- Throws:
java.security.GeneralSecurityException
-
getPrimitiveClass
java.lang.Class<P> getPrimitiveClass()
Returns 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.
-
getInputPrimitiveClass
java.lang.Class<B> getInputPrimitiveClass()
Returns the primitive class object of the primitive used to create B. Used for internal management. Should be implemented asreturn B.class;.
-
-