Class AeadWrapper

  • All Implemented Interfaces:
    PrimitiveWrapper<Aead,​Aead>

    public class AeadWrapper
    extends java.lang.Object
    implements PrimitiveWrapper<Aead,​Aead>
    AeadWrapper is the implementation of SetWrapper for the Aead primitive.

    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.

    • Method Detail

      • getPrimitiveClass

        public java.lang.Class<Aead> getPrimitiveClass()
        Description copied from interface: PrimitiveWrapper
        Returns the primitive class object of the primitive managed. Used for internal management. Should be implemented as return P.class; when implementing a wrapper creating objects of type P.
        Specified by:
        getPrimitiveClass in interface PrimitiveWrapper<Aead,​Aead>
      • getInputPrimitiveClass

        public java.lang.Class<Aead> getInputPrimitiveClass()
        Description copied from interface: PrimitiveWrapper
        Returns the primitive class object of the primitive used to create B. Used for internal management. Should be implemented as return B.class;.
        Specified by:
        getInputPrimitiveClass in interface PrimitiveWrapper<Aead,​Aead>
      • 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 of AeadWrapper to the provided PrimitiveRegistry.Builder.
        Throws:
        java.security.GeneralSecurityException