EVP_PKEY_CTX_ctrl.3 revision 337982
Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35)

Standard preamble:
========================================================================
..
..
.. Set up some character translations and predefined strings. \*(-- will
give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
double quote, and \*(R" will give a right double quote. \*(C+ will
give a nicer C++. Capital omega is used to do unbreakable dashes and
therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
nothing in troff, for use with C<>.
.tr \(*W- . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.

If the F register is >0, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.

Avoid warning from groff about undefined register 'F'.
.. . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\}
Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] .\} . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents . \" corrections for vroff . \" for low resolution devices (crt and lpr) \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} ========================================================================

Title "EVP_PKEY_CTX_ctrl 3"
EVP_PKEY_CTX_ctrl 3 "2018-08-14" "1.0.2p" "OpenSSL"
For nroff, turn off justification. Always turn off hyphenation; it makes
way too many mistakes in technical documents.
"NAME"
EVP_PKEY_CTX_ctrl, EVP_PKEY_CTX_ctrl_str, EVP_PKEY_CTX_set_signature_md, EVP_PKEY_CTX_set_rsa_padding, EVP_PKEY_CTX_set_rsa_pss_saltlen, EVP_PKEY_CTX_set_rsa_rsa_keygen_bits, EVP_PKEY_CTX_set_rsa_keygen_pubexp, EVP_PKEY_CTX_set_dsa_paramgen_bits, EVP_PKEY_CTX_set_dh_paramgen_prime_len, EVP_PKEY_CTX_set_dh_paramgen_generator, EVP_PKEY_CTX_set_ec_paramgen_curve_nid - algorithm specific control operations
"SYNOPSIS"
Header "SYNOPSIS" .Vb 1 #include <openssl/evp.h> \& int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, int cmd, int p1, void *p2); int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, const char *type, const char *value); \& #include <openssl/rsa.h> \& int EVP_PKEY_CTX_set_signature_md(EVP_PKEY_CTX *ctx, const EVP_MD *md); \& int EVP_PKEY_CTX_set_rsa_padding(EVP_PKEY_CTX *ctx, int pad); int EVP_PKEY_CTX_set_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int len); int EVP_PKEY_CTX_set_rsa_rsa_keygen_bits(EVP_PKEY_CTX *ctx, int mbits); int EVP_PKEY_CTX_set_rsa_keygen_pubexp(EVP_PKEY_CTX *ctx, BIGNUM *pubexp); \& #include <openssl/dsa.h> int EVP_PKEY_CTX_set_dsa_paramgen_bits(EVP_PKEY_CTX *ctx, int nbits); \& #include <openssl/dh.h> int EVP_PKEY_CTX_set_dh_paramgen_prime_len(EVP_PKEY_CTX *ctx, int len); int EVP_PKEY_CTX_set_dh_paramgen_generator(EVP_PKEY_CTX *ctx, int gen); \& #include <openssl/ec.h> int EVP_PKEY_CTX_set_ec_paramgen_curve_nid(EVP_PKEY_CTX *ctx, int nid); .Ve
"DESCRIPTION"
Header "DESCRIPTION" The function EVP_PKEY_CTX_ctrl() sends a control operation to the context \fBctx. The key type used must match keytype if it is not -1. The parameter \fBoptype is a mask indicating which operations the control can be applied to. The control command is indicated in cmd and any additional arguments in \fBp1 and p2.

Applications will not normally call EVP_PKEY_CTX_ctrl() directly but will instead call one of the algorithm specific macros below.

The function EVP_PKEY_CTX_ctrl_str() allows an application to send an algorithm specific control operation to a context ctx in string form. This is intended to be used for options specified on the command line or in text files. The commands supported are documented in the openssl utility command line pages for the option -pkeyopt which is supported by the \fBpkeyutl, genpkey and req commands.

All the remaining \*(L"functions\*(R" are implemented as macros.

The EVP_PKEY_CTX_set_signature_md() macro sets the message digest type used in a signature. It can be used with any public key algorithm supporting signature operations.

The macro EVP_PKEY_CTX_set_rsa_padding() sets the \s-1RSA\s0 padding mode for ctx. The pad parameter can take the value \s-1RSA_PKCS1_PADDING\s0 for PKCS#1 padding, \s-1RSA_SSLV23_PADDING\s0 for SSLv23 padding, \s-1RSA_NO_PADDING\s0 for no padding, \s-1RSA_PKCS1_OAEP_PADDING\s0 for \s-1OAEP\s0 padding (encrypt and decrypt only), \s-1RSA_X931_PADDING\s0 for X9.31 padding (signature operations only) and \s-1RSA_PKCS1_PSS_PADDING\s0 (sign and verify only).

Two \s-1RSA\s0 padding modes behave differently if EVP_PKEY_CTX_set_signature_md() is used. If this macro is called for PKCS#1 padding the plaintext buffer is an actual digest value and is encapsulated in a DigestInfo structure according to PKCS#1 when signing and this structure is expected (and stripped off) when verifying. If this control is not used with \s-1RSA\s0 and PKCS#1 padding then the supplied data is used directly and not encapsulated. In the case of X9.31 padding for \s-1RSA\s0 the algorithm identifier byte is added or checked and removed if this control is called. If it is not called then the first byte of the plaintext buffer is expected to be the algorithm identifier byte.

The EVP_PKEY_CTX_set_rsa_pss_saltlen() macro sets the \s-1RSA PSS\s0 salt length to \fBlen as its name implies it is only supported for \s-1PSS\s0 padding. Two special values are supported: -1 sets the salt length to the digest length. When signing -2 sets the salt length to the maximum permissible value. When verifying -2 causes the salt length to be automatically determined based on the \fB\s-1PSS\s0 block structure. If this macro is not called a salt length value of -2 is used by default.

The EVP_PKEY_CTX_set_rsa_rsa_keygen_bits() macro sets the \s-1RSA\s0 key length for \s-1RSA\s0 key genration to bits. If not specified 1024 bits is used.

The EVP_PKEY_CTX_set_rsa_keygen_pubexp() macro sets the public exponent value for \s-1RSA\s0 key generation to pubexp currently it should be an odd integer. The \fBpubexp pointer is used internally by this function so it should not be modified or free after the call. If this macro is not called then 65537 is used.

The macro EVP_PKEY_CTX_set_dsa_paramgen_bits() sets the number of bits used for \s-1DSA\s0 parameter generation to bits. If not specified 1024 is used.

The macro EVP_PKEY_CTX_set_dh_paramgen_prime_len() sets the length of the \s-1DH\s0 prime parameter p for \s-1DH\s0 parameter generation. If this macro is not called then 1024 is used.

The EVP_PKEY_CTX_set_dh_paramgen_generator() macro sets \s-1DH\s0 generator to gen for \s-1DH\s0 parameter generation. If not specified 2 is used.

The EVP_PKEY_CTX_set_ec_paramgen_curve_nid() sets the \s-1EC\s0 curve for \s-1EC\s0 parameter generation to nid. For \s-1EC\s0 parameter generation this macro must be called or an error occurs because there is no default curve.

"RETURN VALUES"
Header "RETURN VALUES" \fIEVP_PKEY_CTX_ctrl() and its macros return a positive value for success and 0 or a negative value for failure. In particular a return value of -2 indicates the operation is not supported by the public key algorithm.
"SEE ALSO"
Header "SEE ALSO" \fIEVP_PKEY_CTX_new\|(3), \fIEVP_PKEY_encrypt\|(3), \fIEVP_PKEY_decrypt\|(3), \fIEVP_PKEY_sign\|(3), \fIEVP_PKEY_verify\|(3), \fIEVP_PKEY_verify_recover\|(3), \fIEVP_PKEY_derive\|(3) \fIEVP_PKEY_keygen\|(3)
"HISTORY"
Header "HISTORY" These functions were first added to OpenSSL 1.0.0.