public class AeadWrapper extends Object implements PrimitiveWrapper<Aead,Aead>
Key rotation works as follows: each ciphertext is prefixed with the keyId. When decrypting, we first try all primitives whose keyId starts with the prefix of the ciphertext. If none of these succeed, we try the raw primitives. If any succeeds, we return the ciphertext, otherwise we simply throw a GeneralSecurityException.
| Modifier and Type | Method and Description |
|---|---|
Class<Aead> |
getInputPrimitiveClass()
Returns the primitive class object of the primitive used to create B.
|
Class<Aead> |
getPrimitiveClass()
Returns the primitive class object of the primitive managed.
|
static void |
register() |
static void |
registerToInternalPrimitiveRegistry(PrimitiveRegistry.Builder primitiveRegistryBuilder)
registerToInternalPrimitiveRegistry is a non-public method (it takes an argument of an
internal-only type) registering an instance of
AeadWrapper to the provided PrimitiveRegistry.Builder. |
Aead |
wrap(PrimitiveSet<Aead> pset)
Wraps a
PrimitiveSet and returns a single instance. |
public Aead wrap(PrimitiveSet<Aead> pset) throws GeneralSecurityException
PrimitiveWrapperPrimitiveSet and returns a single instance.
This method gets called when a new primitive is created. primitiveSet is immutable.
This has to be implemented when a new primitive type is added.
wrap in interface PrimitiveWrapper<Aead,Aead>GeneralSecurityExceptionpublic Class<Aead> getPrimitiveClass()
PrimitiveWrapperreturn P.class; when implementing a wrapper creating objects
of type P.getPrimitiveClass in interface PrimitiveWrapper<Aead,Aead>public Class<Aead> getInputPrimitiveClass()
PrimitiveWrapperreturn B.class;.getInputPrimitiveClass in interface PrimitiveWrapper<Aead,Aead>public static void register()
throws GeneralSecurityException
GeneralSecurityExceptionpublic static void registerToInternalPrimitiveRegistry(PrimitiveRegistry.Builder primitiveRegistryBuilder) throws GeneralSecurityException
AeadWrapper to the provided PrimitiveRegistry.Builder.GeneralSecurityException