Class CMACAlgorithm


  • public class CMACAlgorithm
    extends DigestAlgorithm
    Algorithms for performing CMACs. These can be used to create MessageDigests.
    • Field Detail

      • AES

        public static final CMACAlgorithm AES
        CMAC AES-X. This is a Message Authentication Code that uses a symmetric key together with the AES cipher to create a form of signature. Note that we pass null for the OID here: neither NIST nor any other standards body has defined an OID for use with CMAC. Since we use a PKCS#11 backend and NSS doesn't otherwise define CMAC based on a SEC OID, we don't strictly need one. We've left the fromOID code (and oid parameter in the constructor) as other projects use them for HMACAlgorith. At such time as an OID is defined, it can be added here.
    • Constructor Detail

      • CMACAlgorithm

        protected CMACAlgorithm​(int oidIndex,
                                java.lang.String name,
                                OBJECT_IDENTIFIER oid,
                                int outputSize)
    • Method Detail

      • fromOID

        public static CMACAlgorithm fromOID​(OBJECT_IDENTIFIER oid)
                                     throws java.security.NoSuchAlgorithmException
        Looks up the CMAC algorithm with the given OID.
        Parameters:
        oid - OID.
        Returns:
        CMAC algorithm.
        Throws:
        java.security.NoSuchAlgorithmException - If no registered CMAC algorithm has the given OID.