[#EVP_PKEY_asn1_set_public]
= EVP&lowbar;PKEY&lowbar;asn1&lowbar;set&lowbar;public
:mrdocs:

Install public&hyphen;key decode, encode, compare, print, size, and bits callbacks on an ASN&period;1 method&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
EVP&lowbar;PKEY&lowbar;asn1&lowbar;set&lowbar;public(
    xref:EVP_PKEY_ASN1_METHOD.adoc[EVP&lowbar;PKEY&lowbar;ASN1&lowbar;METHOD]* ameth,
    int(* pub&lowbar;decode)(xref:EVP_PKEY.adoc[EVP&lowbar;PKEY]*, xref:X509_PUBKEY.adoc[X509&lowbar;PUBKEY] const*),
    int(* pub&lowbar;encode)(xref:X509_PUBKEY.adoc[X509&lowbar;PUBKEY]*, xref:EVP_PKEY.adoc[EVP&lowbar;PKEY] const*),
    int(* pub&lowbar;cmp)(xref:EVP_PKEY.adoc[EVP&lowbar;PKEY] const*, xref:EVP_PKEY.adoc[EVP&lowbar;PKEY] const*),
    int(* pub&lowbar;print)(xref:BIO.adoc[BIO]*, xref:EVP_PKEY.adoc[EVP&lowbar;PKEY] const*, int, xref:ASN1_PCTX.adoc[ASN1&lowbar;PCTX]*),
    int(* pkey&lowbar;size)(xref:EVP_PKEY.adoc[EVP&lowbar;PKEY] const*),
    int(* pkey&lowbar;bits)(xref:EVP_PKEY.adoc[EVP&lowbar;PKEY] const*));
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ameth*
| ASN&period;1 method being customized&period;
| *pub&lowbar;decode*
| Decode an X509&lowbar;PUBKEY into `pk&period;`
| *pub&lowbar;encode*
| Encode `pk` into an X509&lowbar;PUBKEY&period;
| *pub&lowbar;cmp*
| Compare two public keys (1 match, 0 differ, negative on error)&period;
| *pub&lowbar;print*
| Print the public key to a BIO&period;
| *pkey&lowbar;size*
| Return the maximum output size in bytes for operations with `pk&period;`
| *pkey&lowbar;bits*
| Return the key size in bits for `pk&period;`
|===


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