[#PEM_write_ECPrivateKey]
= PEM&lowbar;write&lowbar;ECPrivateKey
:mrdocs:

Write an EC private key to a FILE in PEM form (deprecated)&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;deprecated&rsqb;&rsqb;
int
PEM&lowbar;write&lowbar;ECPrivateKey(
    FILE* fp,
    xref:EC_KEY.adoc[EC&lowbar;KEY] const* x,
    xref:EVP_CIPHER-07.adoc[EVP&lowbar;CIPHER] const* enc,
    unsigned char const* kstr,
    int klen,
    xref:pem_password_cb.adoc[pem&lowbar;password&lowbar;cb]* cb,
    void* u);
----

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

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *fp*
| FILE to write to&period;
| *x*
| EC&lowbar;KEY to encode&period;
| *enc*
| Optional cipher for traditional PEM encryption, or NULL for cleartext&period;
| *kstr*
| Optional encryption key bytes used with `enc,` or NULL to prompt via `cb&period;`
| *klen*
| Length of `kstr` when provided&period;
| *cb*
| Password callback when encryption needs a passphrase, or NULL&period;
| *u*
| Application data passed to `cb&period;`
|===


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