[#EC_KEY_key2buf]
= EC&lowbar;KEY&lowbar;key2buf
:mrdocs:

Encodes an EC&lowbar;KEY public key to an allocated octet string

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;deprecated&rsqb;&rsqb;
size&lowbar;t
EC&lowbar;KEY&lowbar;key2buf(
    xref:EC_KEY.adoc[EC&lowbar;KEY] const* key,
    point&lowbar;conversion&lowbar;form&lowbar;t form,
    unsigned char** pbuf,
    xref:BN_CTX.adoc[BN&lowbar;CTX]* ctx);
----

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

the length of the encoded octet string or 0 if an error occurred

== Parameters

[cols="1,4"]
|===
| Name| Description
| *key*
| key to encode
| *form*
| point conversion form
| *pbuf*
| returns pointer to allocated buffer
| *ctx*
| BN&lowbar;CTX object (optional)
|===


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