[#AES_wrap_key]
= AES&lowbar;wrap&lowbar;key
:mrdocs:

Wrap (encrypt) a key with AES Key Wrap per RFC 3394 (deprecated&semi; prefer EVP)&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;deprecated&rsqb;&rsqb;
int
AES&lowbar;wrap&lowbar;key(
    xref:AES_KEY.adoc[AES&lowbar;KEY]* key,
    unsigned char const* iv,
    unsigned char* out,
    unsigned char const* in,
    unsigned int inlen);
----

[WARNING]
====
https://en.cppreference.com/cpp/language/attributes/deprecated[Deprecated^]. Use of this entity is allowed but discouraged.
====
== Return Value

Length of wrapped data written to `out,` or a negative value on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *key*
| Expanded AES key used as the Key Encryption Key&period;
| *iv*
| Optional 8&hyphen;byte integrity check value, or NULL for the default IV&period;
| *out*
| Buffer for the wrapped key (at least `inlen` &plus; 8 bytes)&period;
| *in*
| Key material to wrap&semi; length must be a multiple of 8&period;
| *inlen*
| Length of `in` in bytes&period;
|===


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