359 lines
16 KiB
HTML
359 lines
16 KiB
HTML
|
<?xml version="1.0" ?>
|
||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
|
<head>
|
||
|
<title>EVP_PKEY-RSA</title>
|
||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||
|
<link rev="made" href="mailto:" />
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
|
||
|
|
||
|
|
||
|
<ul id="index">
|
||
|
<li><a href="#NAME">NAME</a></li>
|
||
|
<li><a href="#DESCRIPTION">DESCRIPTION</a>
|
||
|
<ul>
|
||
|
<li><a href="#Common-RSA-parameters">Common RSA parameters</a></li>
|
||
|
<li><a href="#RSA-key-generation-parameters">RSA key generation parameters</a></li>
|
||
|
<li><a href="#RSA-key-generation-parameters-for-FIPS-module-testing">RSA key generation parameters for FIPS module testing</a></li>
|
||
|
<li><a href="#RSA-key-parameters-for-FIPS-module-testing">RSA key parameters for FIPS module testing</a></li>
|
||
|
<li><a href="#RSA-key-validation">RSA key validation</a></li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li><a href="#CONFORMING-TO">CONFORMING TO</a></li>
|
||
|
<li><a href="#EXAMPLES">EXAMPLES</a></li>
|
||
|
<li><a href="#SEE-ALSO">SEE ALSO</a></li>
|
||
|
<li><a href="#COPYRIGHT">COPYRIGHT</a></li>
|
||
|
</ul>
|
||
|
|
||
|
<h1 id="NAME">NAME</h1>
|
||
|
|
||
|
<p>EVP_PKEY-RSA, EVP_KEYMGMT-RSA, RSA - EVP_PKEY RSA keytype and algorithm support</p>
|
||
|
|
||
|
<h1 id="DESCRIPTION">DESCRIPTION</h1>
|
||
|
|
||
|
<p>The <b>RSA</b> keytype is implemented in OpenSSL's default and FIPS providers. That implementation supports the basic RSA keys, containing the modulus <i>n</i>, the public exponent <i>e</i>, the private exponent <i>d</i>, and a collection of prime factors, exponents and coefficient for CRT calculations, of which the first few are known as <i>p</i> and <i>q</i>, <i>dP</i> and <i>dQ</i>, and <i>qInv</i>.</p>
|
||
|
|
||
|
<h2 id="Common-RSA-parameters">Common RSA parameters</h2>
|
||
|
|
||
|
<p>In addition to the common parameters that all keytypes should support (see <a href="../man7/provider-keymgmt.html">"Common parameters" in provider-keymgmt(7)</a>), the <b>RSA</b> keytype implementation supports the following.</p>
|
||
|
|
||
|
<dl>
|
||
|
|
||
|
<dt id="n-OSSL_PKEY_PARAM_RSA_N-unsigned-integer">"n" (<b>OSSL_PKEY_PARAM_RSA_N</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
<p>The RSA modulus "n" value.</p>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="e-OSSL_PKEY_PARAM_RSA_E-unsigned-integer">"e" (<b>OSSL_PKEY_PARAM_RSA_E</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
<p>The RSA public exponent "e" value. This value must always be set when creating a raw key using <a href="../man3/EVP_PKEY_fromdata.html">EVP_PKEY_fromdata(3)</a>. Note that when a decryption operation is performed, that this value is used for blinding purposes to prevent timing attacks.</p>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="d-OSSL_PKEY_PARAM_RSA_D-unsigned-integer">"d" (<b>OSSL_PKEY_PARAM_RSA_D</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
<p>The RSA private exponent "d" value.</p>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-factor1-OSSL_PKEY_PARAM_RSA_FACTOR1-unsigned-integer">"rsa-factor1" (<b>OSSL_PKEY_PARAM_RSA_FACTOR1</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-factor2-OSSL_PKEY_PARAM_RSA_FACTOR2-unsigned-integer">"rsa-factor2" (<b>OSSL_PKEY_PARAM_RSA_FACTOR2</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-factor3-OSSL_PKEY_PARAM_RSA_FACTOR3-unsigned-integer">"rsa-factor3" (<b>OSSL_PKEY_PARAM_RSA_FACTOR3</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-factor4-OSSL_PKEY_PARAM_RSA_FACTOR4-unsigned-integer">"rsa-factor4" (<b>OSSL_PKEY_PARAM_RSA_FACTOR4</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-factor5-OSSL_PKEY_PARAM_RSA_FACTOR5-unsigned-integer">"rsa-factor5" (<b>OSSL_PKEY_PARAM_RSA_FACTOR5</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-factor6-OSSL_PKEY_PARAM_RSA_FACTOR6-unsigned-integer">"rsa-factor6" (<b>OSSL_PKEY_PARAM_RSA_FACTOR6</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-factor7-OSSL_PKEY_PARAM_RSA_FACTOR7-unsigned-integer">"rsa-factor7" (<b>OSSL_PKEY_PARAM_RSA_FACTOR7</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-factor8-OSSL_PKEY_PARAM_RSA_FACTOR8-unsigned-integer">"rsa-factor8" (<b>OSSL_PKEY_PARAM_RSA_FACTOR8</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-factor9-OSSL_PKEY_PARAM_RSA_FACTOR9-unsigned-integer">"rsa-factor9" (<b>OSSL_PKEY_PARAM_RSA_FACTOR9</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-factor10-OSSL_PKEY_PARAM_RSA_FACTOR10-unsigned-integer">"rsa-factor10" (<b>OSSL_PKEY_PARAM_RSA_FACTOR10</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
<p>RSA prime factors. The factors are known as "p", "q" and "r_i" in RFC8017. Up to eight additional "r_i" prime factors are supported.</p>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-exponent1-OSSL_PKEY_PARAM_RSA_EXPONENT1-unsigned-integer">"rsa-exponent1" (<b>OSSL_PKEY_PARAM_RSA_EXPONENT1</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-exponent2-OSSL_PKEY_PARAM_RSA_EXPONENT2-unsigned-integer">"rsa-exponent2" (<b>OSSL_PKEY_PARAM_RSA_EXPONENT2</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-exponent3-OSSL_PKEY_PARAM_RSA_EXPONENT3-unsigned-integer">"rsa-exponent3" (<b>OSSL_PKEY_PARAM_RSA_EXPONENT3</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-exponent4-OSSL_PKEY_PARAM_RSA_EXPONENT4-unsigned-integer">"rsa-exponent4" (<b>OSSL_PKEY_PARAM_RSA_EXPONENT4</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-exponent5-OSSL_PKEY_PARAM_RSA_EXPONENT5-unsigned-integer">"rsa-exponent5" (<b>OSSL_PKEY_PARAM_RSA_EXPONENT5</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-exponent6-OSSL_PKEY_PARAM_RSA_EXPONENT6-unsigned-integer">"rsa-exponent6" (<b>OSSL_PKEY_PARAM_RSA_EXPONENT6</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-exponent7-OSSL_PKEY_PARAM_RSA_EXPONENT7-unsigned-integer">"rsa-exponent7" (<b>OSSL_PKEY_PARAM_RSA_EXPONENT7</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-exponent8-OSSL_PKEY_PARAM_RSA_EXPONENT8-unsigned-integer">"rsa-exponent8" (<b>OSSL_PKEY_PARAM_RSA_EXPONENT8</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-exponent9-OSSL_PKEY_PARAM_RSA_EXPONENT9-unsigned-integer">"rsa-exponent9" (<b>OSSL_PKEY_PARAM_RSA_EXPONENT9</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-exponent10-OSSL_PKEY_PARAM_RSA_EXPONENT10-unsigned-integer">"rsa-exponent10" (<b>OSSL_PKEY_PARAM_RSA_EXPONENT10</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
<p>RSA CRT (Chinese Remainder Theorem) exponents. The exponents are known as "dP", "dQ" and "d_i" in RFC8017. Up to eight additional "d_i" exponents are supported.</p>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-coefficient1-OSSL_PKEY_PARAM_RSA_COEFFICIENT1-unsigned-integer">"rsa-coefficient1" (<b>OSSL_PKEY_PARAM_RSA_COEFFICIENT1</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-coefficient2-OSSL_PKEY_PARAM_RSA_COEFFICIENT2-unsigned-integer">"rsa-coefficient2" (<b>OSSL_PKEY_PARAM_RSA_COEFFICIENT2</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-coefficient3-OSSL_PKEY_PARAM_RSA_COEFFICIENT3-unsigned-integer">"rsa-coefficient3" (<b>OSSL_PKEY_PARAM_RSA_COEFFICIENT3</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-coefficient4-OSSL_PKEY_PARAM_RSA_COEFFICIENT4-unsigned-integer">"rsa-coefficient4" (<b>OSSL_PKEY_PARAM_RSA_COEFFICIENT4</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-coefficient5-OSSL_PKEY_PARAM_RSA_COEFFICIENT5-unsigned-integer">"rsa-coefficient5" (<b>OSSL_PKEY_PARAM_RSA_COEFFICIENT5</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-coefficient6-OSSL_PKEY_PARAM_RSA_COEFFICIENT6-unsigned-integer">"rsa-coefficient6" (<b>OSSL_PKEY_PARAM_RSA_COEFFICIENT6</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-coefficient7-OSSL_PKEY_PARAM_RSA_COEFFICIENT7-unsigned-integer">"rsa-coefficient7" (<b>OSSL_PKEY_PARAM_RSA_COEFFICIENT7</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-coefficient8-OSSL_PKEY_PARAM_RSA_COEFFICIENT8-unsigned-integer">"rsa-coefficient8" (<b>OSSL_PKEY_PARAM_RSA_COEFFICIENT8</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="rsa-coefficient9-OSSL_PKEY_PARAM_RSA_COEFFICIENT9-unsigned-integer">"rsa-coefficient9" (<b>OSSL_PKEY_PARAM_RSA_COEFFICIENT9</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
<p>RSA CRT (Chinese Remainder Theorem) coefficients. The coefficients are known as "qInv" and "t_i". Up to eight additional "t_i" exponents are supported.</p>
|
||
|
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
<h2 id="RSA-key-generation-parameters">RSA key generation parameters</h2>
|
||
|
|
||
|
<p>When generating RSA keys, the following key generation parameters may be used.</p>
|
||
|
|
||
|
<dl>
|
||
|
|
||
|
<dt id="bits-OSSL_PKEY_PARAM_RSA_BITS-unsigned-integer">"bits" (<b>OSSL_PKEY_PARAM_RSA_BITS</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
<p>The value should be the cryptographic length for the <b>RSA</b> cryptosystem, in bits.</p>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="primes-OSSL_PKEY_PARAM_RSA_PRIMES-unsigned-integer">"primes" (<b>OSSL_PKEY_PARAM_RSA_PRIMES</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
<p>The value should be the number of primes for the generated <b>RSA</b> key. The default is 2. It isn't permitted to specify a larger number of primes than 10. Additionally, the number of primes is limited by the length of the key being generated so the maximum number could be less. Some providers may only support a value of 2.</p>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="e-OSSL_PKEY_PARAM_RSA_E-unsigned-integer1">"e" (<b>OSSL_PKEY_PARAM_RSA_E</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
<p>The RSA "e" value. The value may be any odd number greater than or equal to 65537. The default value is 65537. For legacy reasons a value of 3 is currently accepted but is deprecated.</p>
|
||
|
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
<h2 id="RSA-key-generation-parameters-for-FIPS-module-testing">RSA key generation parameters for FIPS module testing</h2>
|
||
|
|
||
|
<p>When generating RSA keys, the following additional key generation parameters may be used for algorithm testing purposes only. Do not use these to generate RSA keys for a production environment.</p>
|
||
|
|
||
|
<dl>
|
||
|
|
||
|
<dt id="xp-OSSL_PKEY_PARAM_RSA_TEST_XP-unsigned-integer">"xp" (<b>OSSL_PKEY_PARAM_RSA_TEST_XP</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="xq-OSSL_PKEY_PARAM_RSA_TEST_XQ-unsigned-integer">"xq" (<b>OSSL_PKEY_PARAM_RSA_TEST_XQ</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
<p>These 2 fields are normally randomly generated and are used to generate "p" and "q".</p>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="xp1-OSSL_PKEY_PARAM_RSA_TEST_XP1-unsigned-integer">"xp1" (<b>OSSL_PKEY_PARAM_RSA_TEST_XP1</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="xp2-OSSL_PKEY_PARAM_RSA_TEST_XP2-unsigned-integer">"xp2" (<b>OSSL_PKEY_PARAM_RSA_TEST_XP2</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="xq1-OSSL_PKEY_PARAM_RSA_TEST_XQ1-unsigned-integer">"xq1" (<b>OSSL_PKEY_PARAM_RSA_TEST_XQ1</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="xq2-OSSL_PKEY_PARAM_RSA_TEST_XQ2-unsigned-integer">"xq2" (<b>OSSL_PKEY_PARAM_RSA_TEST_XQ2</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
<p>These 4 fields are normally randomly generated. The prime factors "p1", "p2", "q1" and "q2" are determined from these values.</p>
|
||
|
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
<h2 id="RSA-key-parameters-for-FIPS-module-testing">RSA key parameters for FIPS module testing</h2>
|
||
|
|
||
|
<p>The following intermediate values can be retrieved only if the values specified in <a href="#RSA-key-generation-parameters-for-FIPS-module-testing">"RSA key generation parameters for FIPS module testing"</a> are set. These should not be accessed in a production environment.</p>
|
||
|
|
||
|
<dl>
|
||
|
|
||
|
<dt id="p1-OSSL_PKEY_PARAM_RSA_TEST_P1-unsigned-integer">"p1" (<b>OSSL_PKEY_PARAM_RSA_TEST_P1</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="p2-OSSL_PKEY_PARAM_RSA_TEST_P2-unsigned-integer">"p2" (<b>OSSL_PKEY_PARAM_RSA_TEST_P2</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="q1-OSSL_PKEY_PARAM_RSA_TEST_Q1-unsigned-integer">"q1" (<b>OSSL_PKEY_PARAM_RSA_TEST_Q1</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="q2-OSSL_PKEY_PARAM_RSA_TEST_Q2-unsigned-integer">"q2" (<b>OSSL_PKEY_PARAM_RSA_TEST_Q2</b>) <unsigned integer></dt>
|
||
|
<dd>
|
||
|
|
||
|
<p>The auxiliary probable primes.</p>
|
||
|
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
<h2 id="RSA-key-validation">RSA key validation</h2>
|
||
|
|
||
|
<p>For RSA keys, <a href="../man3/EVP_PKEY_param_check.html">EVP_PKEY_param_check(3)</a> and <a href="../man3/EVP_PKEY_param_check_quick.html">EVP_PKEY_param_check_quick(3)</a> both return 1 unconditionally.</p>
|
||
|
|
||
|
<p>For RSA keys, <a href="../man3/EVP_PKEY_public_check.html">EVP_PKEY_public_check(3)</a> conforms to the SP800-56Br1 <i>public key check</i> when the OpenSSL FIPS provider is used. The OpenSSL default provider performs similar tests but relaxes the keysize restrictions for backwards compatibility.</p>
|
||
|
|
||
|
<p>For RSA keys, <a href="../man3/EVP_PKEY_public_check_quick.html">EVP_PKEY_public_check_quick(3)</a> is the same as <a href="../man3/EVP_PKEY_public_check.html">EVP_PKEY_public_check(3)</a>.</p>
|
||
|
|
||
|
<p>For RSA keys, <a href="../man3/EVP_PKEY_private_check.html">EVP_PKEY_private_check(3)</a> conforms to the SP800-56Br1 <i>private key test</i>.</p>
|
||
|
|
||
|
<p>For RSA keys, <a href="../man3/EVP_PKEY_pairwise_check.html">EVP_PKEY_pairwise_check(3)</a> conforms to the SP800-56Br1 <i>KeyPair Validation check</i> for the OpenSSL FIPS provider. The OpenSSL default provider allows testing of the validity of multi-primes.</p>
|
||
|
|
||
|
<h1 id="CONFORMING-TO">CONFORMING TO</h1>
|
||
|
|
||
|
<dl>
|
||
|
|
||
|
<dt id="FIPS186-4">FIPS186-4</dt>
|
||
|
<dd>
|
||
|
|
||
|
<p>Section B.3.6 Generation of Probable Primes with Conditions Based on Auxiliary Probable Primes</p>
|
||
|
|
||
|
</dd>
|
||
|
<dt id="RFC-8017-excluding-RSA-PSS-and-RSA-OAEP">RFC 8017, excluding RSA-PSS and RSA-OAEP</dt>
|
||
|
<dd>
|
||
|
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
<h1 id="EXAMPLES">EXAMPLES</h1>
|
||
|
|
||
|
<p>An <b>EVP_PKEY</b> context can be obtained by calling:</p>
|
||
|
|
||
|
<pre><code> EVP_PKEY_CTX *pctx =
|
||
|
EVP_PKEY_CTX_new_from_name(NULL, "RSA", NULL);</code></pre>
|
||
|
|
||
|
<p>An <b>RSA</b> key can be generated simply like this:</p>
|
||
|
|
||
|
<pre><code> pkey = EVP_RSA_gen(4096);</code></pre>
|
||
|
|
||
|
<p>or like this:</p>
|
||
|
|
||
|
<pre><code> EVP_PKEY *pkey = NULL;
|
||
|
EVP_PKEY_CTX *pctx =
|
||
|
EVP_PKEY_CTX_new_from_name(NULL, "RSA", NULL);
|
||
|
|
||
|
EVP_PKEY_keygen_init(pctx);
|
||
|
EVP_PKEY_generate(pctx, &pkey);
|
||
|
EVP_PKEY_CTX_free(pctx);</code></pre>
|
||
|
|
||
|
<p>An <b>RSA</b> key can be generated with key generation parameters:</p>
|
||
|
|
||
|
<pre><code> unsigned int primes = 3;
|
||
|
unsigned int bits = 4096;
|
||
|
OSSL_PARAM params[3];
|
||
|
EVP_PKEY *pkey = NULL;
|
||
|
EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_from_name(NULL, "RSA", NULL);
|
||
|
|
||
|
EVP_PKEY_keygen_init(pctx);
|
||
|
|
||
|
params[0] = OSSL_PARAM_construct_uint("bits", &bits);
|
||
|
params[1] = OSSL_PARAM_construct_uint("primes", &primes);
|
||
|
params[2] = OSSL_PARAM_construct_end();
|
||
|
EVP_PKEY_CTX_set_params(pctx, params);
|
||
|
|
||
|
EVP_PKEY_generate(pctx, &pkey);
|
||
|
EVP_PKEY_print_private(bio_out, pkey, 0, NULL);
|
||
|
EVP_PKEY_CTX_free(pctx);</code></pre>
|
||
|
|
||
|
<h1 id="SEE-ALSO">SEE ALSO</h1>
|
||
|
|
||
|
<p><a href="../man3/EVP_RSA_gen.html">EVP_RSA_gen(3)</a>, <a href="../man3/EVP_KEYMGMT.html">EVP_KEYMGMT(3)</a>, <a href="../man3/EVP_PKEY.html">EVP_PKEY(3)</a>, <a href="../man7/provider-keymgmt.html">provider-keymgmt(7)</a></p>
|
||
|
|
||
|
<h1 id="COPYRIGHT">COPYRIGHT</h1>
|
||
|
|
||
|
<p>Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.</p>
|
||
|
|
||
|
<p>Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <a href="https://www.openssl.org/source/license.html">https://www.openssl.org/source/license.html</a>.</p>
|
||
|
|
||
|
|
||
|
</body>
|
||
|
|
||
|
</html>
|
||
|
|
||
|
|