[#EVP_PKEY_new_mac_key]
= EVP&lowbar;PKEY&lowbar;new&lowbar;mac&lowbar;key
:mrdocs:

Create an EVP&lowbar;PKEY holding a MAC key for HMAC, CMAC, Poly1305, or SipHash&period;

== Synopsis

Declared in `&lt;openssl&sol;evp&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:EVP_PKEY.adoc[EVP&lowbar;PKEY]*
EVP&lowbar;PKEY&lowbar;new&lowbar;mac&lowbar;key(
    int type,
    xref:ENGINE.adoc[ENGINE]* e,
    unsigned char const* key,
    int keylen);
----

== Description

Prefer EVP&lowbar;MAC &sol; EVP&lowbar;PKEY&lowbar;new&lowbar;raw&lowbar;private&lowbar;key&lowbar;ex() for new code&period;

== Return Value

New EVP&lowbar;PKEY, or NULL on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *type*
| Key type NID (for example EVP&lowbar;PKEY&lowbar;HMAC)&period;
| *e*
| Optional ENGINE implementing the MAC, or NULL&period;
| *key*
| Raw key bytes&period;
| *keylen*
| Length of `key` in bytes&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
