public class AeadWrapper extends Object implements PrimitiveWrapper<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> |
getPrimitiveClass()
Returns the primitive class object of the primitive managed.
|
static void |
register() |
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 has to be implemented when a new primitive type is added.wrap in interface PrimitiveWrapper<Aead>GeneralSecurityExceptionpublic Class<Aead> getPrimitiveClass()
PrimitiveWrapperreturn P.class; when implementing a key manager for
primitive {$code P}.getPrimitiveClass in interface PrimitiveWrapper<Aead>public static void register()
throws GeneralSecurityException
GeneralSecurityException