Class MacWrapper

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

    public class MacWrapper
    extends java.lang.Object
    implements PrimitiveWrapper<Mac,​Mac>
    MacWrapper is the implementation of PrimitiveWrapper for the Mac primitive.

    The returned primitive works with a keyset (rather than a single key). To compute a MAC tag, it uses the primary key in the keyset, and prepends to the tag a certain prefix associated with the primary key. To verify a tag, the primitive uses the prefix of the tag to efficiently select the right key in the set. If the keys associated with the prefix do not validate the tag, the primitive tries all keys with OutputPrefixType.RAW.

    • Method Detail

      • getPrimitiveClass

        public java.lang.Class<Mac> 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<Mac,​Mac>
      • getInputPrimitiveClass

        public java.lang.Class<Mac> 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<Mac,​Mac>
      • 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 MacWrapper to the provided PrimitiveRegistry.Builder.
        Throws:
        java.security.GeneralSecurityException