[#SSL_CTX_use_PrivateKey_ASN1]
= SSL&lowbar;CTX&lowbar;use&lowbar;PrivateKey&lowbar;ASN1
:mrdocs:

Install a private key of type `pk` from a DER buffer on an SSL context&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
SSL&lowbar;CTX&lowbar;use&lowbar;PrivateKey&lowbar;ASN1(
    int pk,
    xref:SSL_CTX.adoc[SSL&lowbar;CTX]* ctx,
    unsigned char const* d,
    long len);
----

== Return Value

* 1 on success, or 0 on failure&period;
* 1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *pk*
| Private&hyphen;key ASN&period;1 type such as EVP&lowbar;PKEY&lowbar;RSA or EVP&lowbar;PKEY&lowbar;EC&period;
| *ctx*
| SSL context that receives the key&semi; it must match any certificate already set&period;
| *d*
| Buffer containing a DER&hyphen;encoded private key of type `pk&period;`
| *len*
| Length of `d` in bytes&period;
|===


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