-.\" $OpenBSD: EVP_PKEY_asn1_new.3,v 1.6 2021/10/25 13:48:12 schwarze Exp $
+.\" $OpenBSD: EVP_PKEY_asn1_new.3,v 1.7 2021/11/06 15:00:25 schwarze Exp $
.\" selective merge up to:
.\" OpenSSL man3/EVP_PKEY_ASN1_METHOD b0004708 Nov 1 00:45:24 2017 +0800
.\"
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: October 25 2021 $
+.Dd $Mdocdate: November 6 2021 $
.Dt EVP_PKEY_ASN1_NEW 3
.Os
.Sh NAME
.Vt EVP_PKEY
object.
.Bd -unfilled
-.Ft int Fo (*pub_decode)
-.Fa "EVP_PKEY *pk"
-.Fa "X509_PUBKEY *pub"
-.Fc
-.Ft int Fo (*pub_encode)
-.Fa "X509_PUBKEY *pub"
-.Fa "const EVP_PKEY *pk"
-.Fc
-.Ft int Fo (*pub_cmp)
-.Fa "const EVP_PKEY *a"
-.Fa "const EVP_PKEY *b"
-.Fc
-.Ft int Fo (*pub_print)
-.Fa "BIO *out"
-.Fa "const EVP_PKEY *pkey"
-.Fa "int indent"
-.Fa "ASN1_PCTX *pctx"
-.Fc
+.Ft int Fn (*pub_decode) "EVP_PKEY *pk" "X509_PUBKEY *pub"
+.Ft int Fn (*pub_encode) "X509_PUBKEY *pub" "const EVP_PKEY *pk"
.Ed
.Pp
-The
-.Fn pub_decode
-and
-.Fn pub_encode
-methods are called to decode and encode
+Decode and encode
.Vt X509_PUBKEY
ASN.1 parameters to and from
.Fa pk .
-They must return 0 on error and 1 on success.
+These methods must return 0 on error and 1 on success.
They are called by
.Xr X509_PUBKEY_get 3
and
.Xr X509_PUBKEY_set 3 .
+.Bd -unfilled
+.Ft int Fn (*pub_cmp) "const EVP_PKEY *a" "const EVP_PKEY *b"
+.Ed
.Pp
-The
-.Fn pub_cmp
-method is called when two public keys are compared.
-It must return 1 when the keys are equal and 0 otherwise.
+Compare two public keys.
+This method must return 1 when the keys are equal and 0 otherwise.
It is called by
.Xr EVP_PKEY_cmp 3 .
+.Bd -filled
+.Ft int Fo (*pub_print)
+.Fa "BIO *out"
+.Fa "const EVP_PKEY *pkey"
+.Fa "int indent"
+.Fa "ASN1_PCTX *pctx"
+.Fc
+.Ed
.Pp
-The
-.Fn pub_print
-method is called to print a public key in humanly readable text to
+Print a public key in humanly readable text to
.Fa out ,
indented
.Fa indent
spaces.
-It must return 0 on error and 1 on success.
+This method must return 0 on error and 1 on success.
It is called by
.Xr EVP_PKEY_print_public 3 .
.Bd -unfilled
-.Ft int Fo (*priv_decode)
-.Fa "EVP_PKEY *pk"
-.Fa "const PKCS8_PRIV_KEY_INFO *p8inf"
-.Fc
-.Ft int Fo (*priv_encode)
-.Fa "PKCS8_PRIV_KEY_INFO *p8"
-.Fa "const EVP_PKEY *pk"
-.Fc
-.Ft int Fo (*priv_print)
-.Fa "BIO *out"
-.Fa "const EVP_PKEY *pkey"
-.Fa "int indent"
-.Fa "ASN1_PCTX *pctx"
-.Fc
+.Ft int Fn (*priv_decode) "EVP_PKEY *pk" "const PKCS8_PRIV_KEY_INFO *p8inf"
+.Ft int Fn (*priv_encode) "PKCS8_PRIV_KEY_INFO *p8" "const EVP_PKEY *pk"
.Ed
.Pp
-The
-.Fn priv_decode
-and
-.Fn priv_encode
-methods are called to decode and encode
+Decode and encode
.Vt PKCS8_PRIV_KEY_INFO
form private key to and from
.Fa pk .
-They must return 0 on error, 1 on success.
+These methods must return 0 on error, 1 on success.
They are called by
.Xr EVP_PKCS82PKEY 3
and
.Xr EVP_PKEY2PKCS8 3 .
+.Bd -filled
+.Ft int Fo (*priv_print)
+.Fa "BIO *out"
+.Fa "const EVP_PKEY *pkey"
+.Fa "int indent"
+.Fa "ASN1_PCTX *pctx"
+.Fc
+.Ed
.Pp
-The
-.Fn priv_print
-method is called to print a private key in humanly readable text to
+Print a private key in humanly readable text to
.Fa out ,
indented
.Fa indent
spaces.
-It must return 0 on error and 1 on success.
+This method must return 0 on error and 1 on success.
It is called by
.Xr EVP_PKEY_print_private 3 .
.Bd -unfilled
.Ft int Fn (*pkey_size) "const EVP_PKEY *pk"
-.Ft int Fn (*pkey_bits) "const EVP_PKEY *pk";
.Ed
.Pp
-The
-.Fn pkey_size
-method returns the key size in bytes.
-It is called by
+Returns the key size in bytes.
+This method is called by
.Xr EVP_PKEY_size 3 .
+.Bd -unfilled
+.Ft int Fn (*pkey_bits) "const EVP_PKEY *pk"
+.Ed
.Pp
-The
-.Fn pkey_bits
-method returns the key size in bits.
-It is called by
+Returns the key size in bits.
+This method is called by
.Xr EVP_PKEY_bits 3 .
-.Bd -unfilled
+.Bd -filled
.Ft int Fo (*param_decode)
.Fa "EVP_PKEY *pkey"
.Fa "const unsigned char **pder"
.Fa "int derlen"
.Fc
+.br
.Ft int Fo (*param_encode)
.Fa "const EVP_PKEY *pkey"
.Fa "unsigned char **pder"
.Fc
-.Ft int Fo (*param_missing)
-.Fa "const EVP_PKEY *pk"
-.Fc
-.Ft int Fo (*param_copy)
-.Fa "EVP_PKEY *to"
-.Fa "const EVP_PKEY *from"
-.Fc
-.Ft int Fo (*param_cmp)
-.Fa "const EVP_PKEY *a"
-.Fa "const EVP_PKEY *b"
-.Fc
-.Ft int Fo (*param_print)
-.Fa "BIO *out"
-.Fa "const EVP_PKEY *pkey"
-.Fa "int indent"
-.Fa "ASN1_PCTX *pctx"
-.Fc
.Ed
.Pp
-The
-.Fn param_decode
-and
-.Fn param_encode
-methods are called to decode and encode DER formatted parameters to and from
+Decode and encode DER formatted parameters to and from
.Fa pk .
-They must return 0 on error and 1 on success.
+These methods must return 0 on error and 1 on success.
They are called by
.Fn PEM_read_bio_Parameters .
+.Bd -unfilled
+.Ft int Fn (*param_missing) "const EVP_PKEY *pk"
+.Ed
.Pp
-The
-.Fn param_missing
-method returns 0 if a key parameter is missing or otherwise 1.
-It is called by
+Return 0 if a key parameter is missing or 1 otherwise.
+This method is called by
.Xr EVP_PKEY_missing_parameters 3 .
+.Bd -unfilled
+.Ft int Fn (*param_copy) "EVP_PKEY *to" "const EVP_PKEY *from"
+.Ed
.Pp
-The
-.Fn param_copy
-method copies key parameters from
+Copy key parameters from
.Fa from
to
.Fa to .
-It must return 0 on error and 1 on success.
+This method must return 0 on error and 1 on success.
It is called by
.Xr EVP_PKEY_copy_parameters 3 .
+.Bd -unfilled
+.Ft int Fn (*param_cmp) "const EVP_PKEY *a" "const EVP_PKEY *b"
+.Ed
.Pp
-The
-.Fn param_cmp
-method compares the parameters of the keys
+Compare the parameters of the keys
.Fa a
and
.Fa b .
-It must return 1 when the keys are equal, 0 when not equal, and a
+This method must return 1 when the keys are equal, 0 when not equal, and a
negative number on error.
It is called by
.Xr EVP_PKEY_cmp_parameters 3 .
+.Bd -filled
+.Ft int Fo (*param_print)
+.Fa "BIO *out"
+.Fa "const EVP_PKEY *pkey"
+.Fa "int indent"
+.Fa "ASN1_PCTX *pctx"
+.Fc
+.Ed
.Pp
-The
-.Fn param_print
-method prints the private key parameters in humanly readable text to
+Print the private key parameters in humanly readable text to
.Fa out ,
indented
.Fa indent
spaces.
-It must return 0 on error and 1 on success.
+This method must return 0 on error and 1 on success.
It is called by
.Xr EVP_PKEY_print_params 3 .
.Bd -unfilled
.Ft void Fn (*pkey_free) "EVP_PKEY *pkey"
.Ed
.Pp
-The
-.Fn pkey_free
-method helps freeing the internals of
+Free the internals of
.Fa pkey .
-It is called by
+This method is called by
.Xr EVP_PKEY_free 3 ,
.Xr EVP_PKEY_set_type 3 ,
.Fn EVP_PKEY_set_type_str ,
and
.Xr EVP_PKEY_assign 3 .
-.Bd -unfilled
+.Bd -filled
.Ft int Fo (*pkey_ctrl)
.Fa "EVP_PKEY *pkey"
.Fa "int op"
.Fc
.Ed
.Pp
-The
-.Fn pkey_ctrl
-method adds extra algorithm specific control.
-It is called by
+Add extra algorithm specific control.
+This method is called by
.Xr EVP_PKEY_get_default_digest_nid 3 ,
.Fn PKCS7_SIGNER_INFO_set ,
.Fn PKCS7_RECIP_INFO_set ,