[#OSSL_ENCODER_CTX_set_cipher]
= OSSL&lowbar;ENCODER&lowbar;CTX&lowbar;set&lowbar;cipher
:mrdocs:

Select the cipher used to encrypt encoded private&hyphen;key material&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
OSSL&lowbar;ENCODER&lowbar;CTX&lowbar;set&lowbar;cipher(
    xref:OSSL_ENCODER_CTX.adoc[OSSL&lowbar;ENCODER&lowbar;CTX]* ctx,
    char const* cipher&lowbar;name,
    char const* propquery);
----

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| Encoder context to configure&period;
| *cipher&lowbar;name*
| Cipher algorithm name (for example &quot;AES&hyphen;256&hyphen;CBC&quot;), or NULL to clear&period;
| *propquery*
| Property query for fetching the cipher, or NULL&period;
|===


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