EVP_PKEY-HMAC(7ossl)
π EVP_PKEY-HMAC β the legacy MAC keytype page (7ossl, bestie)
okay so real talk: this is the 7ossl manual page from OpenSSL, and it's all about the legacy MAC keytypes. It's giving "backwards compatibility era" and honestly we love her for still showing up π
πΈ 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 π¦
So here's the tea β: the HMAC and CMAC key types are implemented in OpenSSL's default provider and the FIPS provider. And extra bonus? The Siphash and Poly1305 key types are implemented in the default provider (just the default one, bestie, don't @ me).
Doing MAC operations via an EVP_PKEY is considered legacy β it's only there for backwards compatibility purposes and for a restricted set of algorithms. Not the main character anymore, lowkey. The preferred way of doing MAC operations is via the EVP_MAC APIs. See EVP_MAC_init(3) β that's the one you actually want, iykyk.
For further details on using EVP_PKEY based MAC keys, go check out EVP_SIGNATURE-HMAC(7), EVP_SIGNATURE-Siphash(7), EVP_SIGNATURE-Poly1305(7) or EVP_SIGNATURE-CMAC(7). Slay, they each get their own page π«Ά
β¨ Common MAC parameters β¨
All the MAC keytypes support these parameters right here:
"priv"(OSSL_PKEY_PARAM_PRIV_KEY)<octet string>β literally just 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 these β she's extra, we respect it:
"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 β
okay this part is genuinely iconic and a little weird: MAC key generation is unusual in that no new key is actually generated. π Like, at all. Instead, a new provider side key object is created with the supplied raw key value. Why? For backwards compatibility with previous versions of OpenSSL, periodt.
"priv"(OSSL_PKEY_PARAM_PRIV_KEY)<octet string>β the MAC key value (yes, again, it's the key value) π
π§ CMAC key generation parameters π§
In addition to the common MAC key generation parameters, the CMAC key generation additionally recognises this one:
"cipher"(OSSL_PKEY_PARAM_CIPHER)<UTF8 string>β the name of a cipher to be used when generating the MAC π«
π₯ SEE ALSO π₯
EVP_KEYMGMT(3), EVP_PKEY(3), provider-keymgmt(7) β go read these, bestie, they're the supporting cast and they ate π
π 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>.
fr fr, read the license before you do anything, don't be that person π
and that's the whole page, no cap π cute little sign-off: this was OpenSSL 3.0.21, dated 2026-06-09, besties β see you in the next manpage! π¦πβ¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms