# EVP_PKEY-HMAC(7SSL) - man - phpMan

[EVP_PKEY-HMAC(7SSL)](https://www.chedong.com/phpMan.php/man/EVPPKEY-HMAC/7SSL/markdown)                            OpenSSL                           [EVP_PKEY-HMAC(7SSL)](https://www.chedong.com/phpMan.php/man/EVPPKEY-HMAC/7SSL/markdown)



## NAME
       EVP_PKEY-HMAC, EVP_KEYMGMT-HMAC, EVP_PKEY-Siphash, EVP_KEYMGMT-Siphash, EVP_PKEY-Poly1305,
       EVP_KEYMGMT-Poly1305, EVP_PKEY-CMAC, EVP_KEYMGMT-CMAC - EVP_PKEY legacy MAC keytypes and
       algorithm support

## DESCRIPTION
       The **HMAC** and **CMAC** key types are implemented in OpenSSL's default and FIPS providers.
       Additionally the **Siphash** and **Poly1305** key types are implemented in the default provider.
       Performing MAC operations via an EVP_PKEY is considered legacy and are only available for
       backwards compatibility purposes and for a restricted set of algorithms. The preferred way of
       performing MAC operations is via the EVP_MAC APIs. See **EVP**___**MAC**___**[init**(3)](https://www.chedong.com/phpMan.php/man/init/3/markdown).

       For further details on using EVP_PKEY based MAC keys see **EVP**___**[SIGNATURE-HMAC**(7)](https://www.chedong.com/phpMan.php/man/SIGNATURE-HMAC/7/markdown),
       **EVP**___**[SIGNATURE-Siphash**(7)](https://www.chedong.com/phpMan.php/man/SIGNATURE-Siphash/7/markdown), **EVP**___**[SIGNATURE-Poly1305**(7)](https://www.chedong.com/phpMan.php/man/SIGNATURE-Poly1305/7/markdown) or **EVP**___**[SIGNATURE-CMAC**(7)](https://www.chedong.com/phpMan.php/man/SIGNATURE-CMAC/7/markdown).

### Common MAC parameters
       All the **MAC** keytypes support the following parameters.

       "priv" (**OSSL**___**PKEY**___**PARAM**___**PRIV**___**KEY**) <octet string>
           The MAC key value.

       "properties" (**OSSL**___**PKEY**___**PARAM**___**PROPERTIES**) <UTF8 string>
           A property query string to be used when any algorithms are fetched.

### CMAC parameters
       As well as the parameters described above, the **CMAC** keytype additionally supports the
       following parameters.

       "cipher" (**OSSL**___**PKEY**___**PARAM**___**CIPHER**) <UTF8 string>
           The name of a cipher to be used when generating the MAC.

       "engine" (**OSSL**___**PKEY**___**PARAM**___**ENGINE**) <UTF8 string>
           The name of an engine to be used for the specified cipher (if any).

### Common MAC key generation parameters
       MAC key generation is unusual in that no new key is actually generated. Instead a new
       provider side key object is created with the supplied raw key value. This is done for
       backwards compatibility with previous versions of OpenSSL.

       "priv" (**OSSL**___**PKEY**___**PARAM**___**PRIV**___**KEY**) <octet string>
           The MAC key value.

### CMAC key generation parameters
       In addition to the common MAC key generation parameters, the CMAC key generation additionally
       recognises the following.

       "cipher" (**OSSL**___**PKEY**___**PARAM**___**CIPHER**) <UTF8 string>
           The name of a cipher to be used when generating the MAC.

## SEE ALSO
       **EVP**___**[KEYMGMT**(3)](https://www.chedong.com/phpMan.php/man/KEYMGMT/3/markdown), **EVP**___**[PKEY**(3)](https://www.chedong.com/phpMan.php/man/PKEY/3/markdown), [**provider-keymgmt**(7)](https://www.chedong.com/phpMan.php/man/provider-keymgmt/7/markdown)

## COPYRIGHT
       Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.

       Licensed under the Apache License 2.0 (the "License").  You may not use this file except in
       compliance with the License.  You can obtain a copy in the file LICENSE in the source
       distribution or at <<https://www.openssl.org/source/license.html>>.



3.0.2                                        2026-04-07                          [EVP_PKEY-HMAC(7SSL)](https://www.chedong.com/phpMan.php/man/EVPPKEY-HMAC/7SSL/markdown)
