| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438 |
- .\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
- .\"
- .\" Standard preamble:
- .\" ========================================================================
- .de Sp \" Vertical space (when we can't use .PP)
- .if t .sp .5v
- .if n .sp
- ..
- .de Vb \" Begin verbatim text
- .ft CW
- .nf
- .ne \\$1
- ..
- .de Ve \" End verbatim text
- .ft R
- .fi
- ..
- .\" 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 C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
- .ie n \{\
- . 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\}
- .el\{\
- . 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.
- .ie \n(.g .ds Aq \(aq
- .el .ds Aq '
- .\"
- .\" 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
- ..
- .nr rF 0
- .if \n(.g .if rF .nr rF 1
- .if (\n(rF:(\n(.g==0)) \{\
- . if \nF \{\
- . de IX
- . tm Index:\\$1\t\\n%\t"\\$2"
- ..
- . if !\nF==2 \{\
- . nr % 0
- . nr F 2
- . \}
- . \}
- .\}
- .rr rF
- .\"
- .\" 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
- .if n \{\
- . ds #H 0
- . ds #V .8m
- . ds #F .3m
- . ds #[ \f1
- . ds #] \fP
- .\}
- .if t \{\
- . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
- . ds #V .6m
- . ds #F 0
- . ds #[ \&
- . ds #] \&
- .\}
- . \" simple accents for nroff and troff
- .if n \{\
- . ds ' \&
- . ds ` \&
- . ds ^ \&
- . ds , \&
- . ds ~ ~
- . ds /
- .\}
- .if t \{\
- . 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
- .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
- .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
- .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
- .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
- .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
- .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
- .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
- .ds ae a\h'-(\w'a'u*4/10)'e
- .ds Ae A\h'-(\w'A'u*4/10)'E
- . \" corrections for vroff
- .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
- .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
- . \" for low resolution devices (crt and lpr)
- .if \n(.H>23 .if \n(.V>19 \
- \{\
- . 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
- .\}
- .rm #[ #] #H #V #F C
- .\" ========================================================================
- .\"
- .IX Title "EVP_PKEY-RSA 7ossl"
- .TH EVP_PKEY-RSA 7ossl "2024-09-03" "3.3.2" "OpenSSL"
- .\" For nroff, turn off justification. Always turn off hyphenation; it makes
- .\" way too many mistakes in technical documents.
- .if n .ad l
- .nh
- .SH "NAME"
- EVP_PKEY\-RSA, EVP_KEYMGMT\-RSA, RSA
- \&\- EVP_PKEY RSA keytype and algorithm support
- .SH "DESCRIPTION"
- .IX Header "DESCRIPTION"
- The \fB\s-1RSA\s0\fR keytype is implemented in OpenSSL's default and \s-1FIPS\s0 providers.
- That implementation supports the basic \s-1RSA\s0 keys, containing the modulus \fIn\fR,
- the public exponent \fIe\fR, the private exponent \fId\fR, and a collection of prime
- factors, exponents and coefficient for \s-1CRT\s0 calculations, of which the first
- few are known as \fIp\fR and \fIq\fR, \fIdP\fR and \fIdQ\fR, and \fIqInv\fR.
- .SS "Common \s-1RSA\s0 parameters"
- .IX Subsection "Common RSA parameters"
- In addition to the common parameters that all keytypes should support (see
- \&\*(L"Common parameters\*(R" in \fBprovider\-keymgmt\fR\|(7)), the \fB\s-1RSA\s0\fR keytype implementation
- supports the following.
- .ie n .IP """n"" (\fB\s-1OSSL_PKEY_PARAM_RSA_N\s0\fR) <unsigned integer>" 4
- .el .IP "``n'' (\fB\s-1OSSL_PKEY_PARAM_RSA_N\s0\fR) <unsigned integer>" 4
- .IX Item "n (OSSL_PKEY_PARAM_RSA_N) <unsigned integer>"
- The \s-1RSA\s0 modulus \*(L"n\*(R" value.
- .ie n .IP """e"" (\fB\s-1OSSL_PKEY_PARAM_RSA_E\s0\fR) <unsigned integer>" 4
- .el .IP "``e'' (\fB\s-1OSSL_PKEY_PARAM_RSA_E\s0\fR) <unsigned integer>" 4
- .IX Item "e (OSSL_PKEY_PARAM_RSA_E) <unsigned integer>"
- The \s-1RSA\s0 public exponent \*(L"e\*(R" value.
- This value must always be set when creating a raw key using \fBEVP_PKEY_fromdata\fR\|(3).
- Note that when a decryption operation is performed, that this value is used for
- blinding purposes to prevent timing attacks.
- .ie n .IP """d"" (\fB\s-1OSSL_PKEY_PARAM_RSA_D\s0\fR) <unsigned integer>" 4
- .el .IP "``d'' (\fB\s-1OSSL_PKEY_PARAM_RSA_D\s0\fR) <unsigned integer>" 4
- .IX Item "d (OSSL_PKEY_PARAM_RSA_D) <unsigned integer>"
- The \s-1RSA\s0 private exponent \*(L"d\*(R" value.
- .ie n .IP """rsa\-factor1"" (\fB\s-1OSSL_PKEY_PARAM_RSA_FACTOR1\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-factor1'' (\fB\s-1OSSL_PKEY_PARAM_RSA_FACTOR1\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-factor1 (OSSL_PKEY_PARAM_RSA_FACTOR1) <unsigned integer>"
- .PD 0
- .ie n .IP """rsa\-factor2"" (\fB\s-1OSSL_PKEY_PARAM_RSA_FACTOR2\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-factor2'' (\fB\s-1OSSL_PKEY_PARAM_RSA_FACTOR2\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-factor2 (OSSL_PKEY_PARAM_RSA_FACTOR2) <unsigned integer>"
- .ie n .IP """rsa\-factor3"" (\fB\s-1OSSL_PKEY_PARAM_RSA_FACTOR3\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-factor3'' (\fB\s-1OSSL_PKEY_PARAM_RSA_FACTOR3\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-factor3 (OSSL_PKEY_PARAM_RSA_FACTOR3) <unsigned integer>"
- .ie n .IP """rsa\-factor4"" (\fB\s-1OSSL_PKEY_PARAM_RSA_FACTOR4\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-factor4'' (\fB\s-1OSSL_PKEY_PARAM_RSA_FACTOR4\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-factor4 (OSSL_PKEY_PARAM_RSA_FACTOR4) <unsigned integer>"
- .ie n .IP """rsa\-factor5"" (\fB\s-1OSSL_PKEY_PARAM_RSA_FACTOR5\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-factor5'' (\fB\s-1OSSL_PKEY_PARAM_RSA_FACTOR5\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-factor5 (OSSL_PKEY_PARAM_RSA_FACTOR5) <unsigned integer>"
- .ie n .IP """rsa\-factor6"" (\fB\s-1OSSL_PKEY_PARAM_RSA_FACTOR6\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-factor6'' (\fB\s-1OSSL_PKEY_PARAM_RSA_FACTOR6\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-factor6 (OSSL_PKEY_PARAM_RSA_FACTOR6) <unsigned integer>"
- .ie n .IP """rsa\-factor7"" (\fB\s-1OSSL_PKEY_PARAM_RSA_FACTOR7\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-factor7'' (\fB\s-1OSSL_PKEY_PARAM_RSA_FACTOR7\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-factor7 (OSSL_PKEY_PARAM_RSA_FACTOR7) <unsigned integer>"
- .ie n .IP """rsa\-factor8"" (\fB\s-1OSSL_PKEY_PARAM_RSA_FACTOR8\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-factor8'' (\fB\s-1OSSL_PKEY_PARAM_RSA_FACTOR8\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-factor8 (OSSL_PKEY_PARAM_RSA_FACTOR8) <unsigned integer>"
- .ie n .IP """rsa\-factor9"" (\fB\s-1OSSL_PKEY_PARAM_RSA_FACTOR9\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-factor9'' (\fB\s-1OSSL_PKEY_PARAM_RSA_FACTOR9\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-factor9 (OSSL_PKEY_PARAM_RSA_FACTOR9) <unsigned integer>"
- .ie n .IP """rsa\-factor10"" (\fB\s-1OSSL_PKEY_PARAM_RSA_FACTOR10\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-factor10'' (\fB\s-1OSSL_PKEY_PARAM_RSA_FACTOR10\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-factor10 (OSSL_PKEY_PARAM_RSA_FACTOR10) <unsigned integer>"
- .PD
- \&\s-1RSA\s0 prime factors. The factors are known as \*(L"p\*(R", \*(L"q\*(R" and \*(L"r_i\*(R" in \s-1RFC8017.\s0
- Up to eight additional \*(L"r_i\*(R" prime factors are supported.
- .ie n .IP """rsa\-exponent1"" (\fB\s-1OSSL_PKEY_PARAM_RSA_EXPONENT1\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-exponent1'' (\fB\s-1OSSL_PKEY_PARAM_RSA_EXPONENT1\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-exponent1 (OSSL_PKEY_PARAM_RSA_EXPONENT1) <unsigned integer>"
- .PD 0
- .ie n .IP """rsa\-exponent2"" (\fB\s-1OSSL_PKEY_PARAM_RSA_EXPONENT2\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-exponent2'' (\fB\s-1OSSL_PKEY_PARAM_RSA_EXPONENT2\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-exponent2 (OSSL_PKEY_PARAM_RSA_EXPONENT2) <unsigned integer>"
- .ie n .IP """rsa\-exponent3"" (\fB\s-1OSSL_PKEY_PARAM_RSA_EXPONENT3\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-exponent3'' (\fB\s-1OSSL_PKEY_PARAM_RSA_EXPONENT3\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-exponent3 (OSSL_PKEY_PARAM_RSA_EXPONENT3) <unsigned integer>"
- .ie n .IP """rsa\-exponent4"" (\fB\s-1OSSL_PKEY_PARAM_RSA_EXPONENT4\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-exponent4'' (\fB\s-1OSSL_PKEY_PARAM_RSA_EXPONENT4\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-exponent4 (OSSL_PKEY_PARAM_RSA_EXPONENT4) <unsigned integer>"
- .ie n .IP """rsa\-exponent5"" (\fB\s-1OSSL_PKEY_PARAM_RSA_EXPONENT5\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-exponent5'' (\fB\s-1OSSL_PKEY_PARAM_RSA_EXPONENT5\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-exponent5 (OSSL_PKEY_PARAM_RSA_EXPONENT5) <unsigned integer>"
- .ie n .IP """rsa\-exponent6"" (\fB\s-1OSSL_PKEY_PARAM_RSA_EXPONENT6\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-exponent6'' (\fB\s-1OSSL_PKEY_PARAM_RSA_EXPONENT6\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-exponent6 (OSSL_PKEY_PARAM_RSA_EXPONENT6) <unsigned integer>"
- .ie n .IP """rsa\-exponent7"" (\fB\s-1OSSL_PKEY_PARAM_RSA_EXPONENT7\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-exponent7'' (\fB\s-1OSSL_PKEY_PARAM_RSA_EXPONENT7\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-exponent7 (OSSL_PKEY_PARAM_RSA_EXPONENT7) <unsigned integer>"
- .ie n .IP """rsa\-exponent8"" (\fB\s-1OSSL_PKEY_PARAM_RSA_EXPONENT8\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-exponent8'' (\fB\s-1OSSL_PKEY_PARAM_RSA_EXPONENT8\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-exponent8 (OSSL_PKEY_PARAM_RSA_EXPONENT8) <unsigned integer>"
- .ie n .IP """rsa\-exponent9"" (\fB\s-1OSSL_PKEY_PARAM_RSA_EXPONENT9\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-exponent9'' (\fB\s-1OSSL_PKEY_PARAM_RSA_EXPONENT9\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-exponent9 (OSSL_PKEY_PARAM_RSA_EXPONENT9) <unsigned integer>"
- .ie n .IP """rsa\-exponent10"" (\fB\s-1OSSL_PKEY_PARAM_RSA_EXPONENT10\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-exponent10'' (\fB\s-1OSSL_PKEY_PARAM_RSA_EXPONENT10\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-exponent10 (OSSL_PKEY_PARAM_RSA_EXPONENT10) <unsigned integer>"
- .PD
- \&\s-1RSA CRT\s0 (Chinese Remainder Theorem) exponents. The exponents are known
- as \*(L"dP\*(R", \*(L"dQ\*(R" and \*(L"d_i\*(R" in \s-1RFC8017.\s0
- Up to eight additional \*(L"d_i\*(R" exponents are supported.
- .ie n .IP """rsa\-coefficient1"" (\fB\s-1OSSL_PKEY_PARAM_RSA_COEFFICIENT1\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-coefficient1'' (\fB\s-1OSSL_PKEY_PARAM_RSA_COEFFICIENT1\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-coefficient1 (OSSL_PKEY_PARAM_RSA_COEFFICIENT1) <unsigned integer>"
- .PD 0
- .ie n .IP """rsa\-coefficient2"" (\fB\s-1OSSL_PKEY_PARAM_RSA_COEFFICIENT2\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-coefficient2'' (\fB\s-1OSSL_PKEY_PARAM_RSA_COEFFICIENT2\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-coefficient2 (OSSL_PKEY_PARAM_RSA_COEFFICIENT2) <unsigned integer>"
- .ie n .IP """rsa\-coefficient3"" (\fB\s-1OSSL_PKEY_PARAM_RSA_COEFFICIENT3\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-coefficient3'' (\fB\s-1OSSL_PKEY_PARAM_RSA_COEFFICIENT3\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-coefficient3 (OSSL_PKEY_PARAM_RSA_COEFFICIENT3) <unsigned integer>"
- .ie n .IP """rsa\-coefficient4"" (\fB\s-1OSSL_PKEY_PARAM_RSA_COEFFICIENT4\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-coefficient4'' (\fB\s-1OSSL_PKEY_PARAM_RSA_COEFFICIENT4\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-coefficient4 (OSSL_PKEY_PARAM_RSA_COEFFICIENT4) <unsigned integer>"
- .ie n .IP """rsa\-coefficient5"" (\fB\s-1OSSL_PKEY_PARAM_RSA_COEFFICIENT5\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-coefficient5'' (\fB\s-1OSSL_PKEY_PARAM_RSA_COEFFICIENT5\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-coefficient5 (OSSL_PKEY_PARAM_RSA_COEFFICIENT5) <unsigned integer>"
- .ie n .IP """rsa\-coefficient6"" (\fB\s-1OSSL_PKEY_PARAM_RSA_COEFFICIENT6\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-coefficient6'' (\fB\s-1OSSL_PKEY_PARAM_RSA_COEFFICIENT6\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-coefficient6 (OSSL_PKEY_PARAM_RSA_COEFFICIENT6) <unsigned integer>"
- .ie n .IP """rsa\-coefficient7"" (\fB\s-1OSSL_PKEY_PARAM_RSA_COEFFICIENT7\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-coefficient7'' (\fB\s-1OSSL_PKEY_PARAM_RSA_COEFFICIENT7\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-coefficient7 (OSSL_PKEY_PARAM_RSA_COEFFICIENT7) <unsigned integer>"
- .ie n .IP """rsa\-coefficient8"" (\fB\s-1OSSL_PKEY_PARAM_RSA_COEFFICIENT8\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-coefficient8'' (\fB\s-1OSSL_PKEY_PARAM_RSA_COEFFICIENT8\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-coefficient8 (OSSL_PKEY_PARAM_RSA_COEFFICIENT8) <unsigned integer>"
- .ie n .IP """rsa\-coefficient9"" (\fB\s-1OSSL_PKEY_PARAM_RSA_COEFFICIENT9\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa\-coefficient9'' (\fB\s-1OSSL_PKEY_PARAM_RSA_COEFFICIENT9\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-coefficient9 (OSSL_PKEY_PARAM_RSA_COEFFICIENT9) <unsigned integer>"
- .PD
- \&\s-1RSA CRT\s0 (Chinese Remainder Theorem) coefficients. The coefficients are known as
- \&\*(L"qInv\*(R" and \*(L"t_i\*(R".
- Up to eight additional \*(L"t_i\*(R" exponents are supported.
- .SS "\s-1RSA\s0 key generation parameters"
- .IX Subsection "RSA key generation parameters"
- When generating \s-1RSA\s0 keys, the following key generation parameters may be used.
- .ie n .IP """bits"" (\fB\s-1OSSL_PKEY_PARAM_RSA_BITS\s0\fR) <unsigned integer>" 4
- .el .IP "``bits'' (\fB\s-1OSSL_PKEY_PARAM_RSA_BITS\s0\fR) <unsigned integer>" 4
- .IX Item "bits (OSSL_PKEY_PARAM_RSA_BITS) <unsigned integer>"
- The value should be the cryptographic length for the \fB\s-1RSA\s0\fR cryptosystem, in
- bits.
- .ie n .IP """primes"" (\fB\s-1OSSL_PKEY_PARAM_RSA_PRIMES\s0\fR) <unsigned integer>" 4
- .el .IP "``primes'' (\fB\s-1OSSL_PKEY_PARAM_RSA_PRIMES\s0\fR) <unsigned integer>" 4
- .IX Item "primes (OSSL_PKEY_PARAM_RSA_PRIMES) <unsigned integer>"
- The value should be the number of primes for the generated \fB\s-1RSA\s0\fR 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.
- .ie n .IP """e"" (\fB\s-1OSSL_PKEY_PARAM_RSA_E\s0\fR) <unsigned integer>" 4
- .el .IP "``e'' (\fB\s-1OSSL_PKEY_PARAM_RSA_E\s0\fR) <unsigned integer>" 4
- .IX Item "e (OSSL_PKEY_PARAM_RSA_E) <unsigned integer>"
- The \s-1RSA\s0 \*(L"e\*(R" 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.
- .ie n .IP """rsa-derive-from-pq"" (\fB\s-1OSSL_PKEY_PARAM_RSA_DERIVE_FROM_PQ\s0\fR) <unsigned integer>" 4
- .el .IP "``rsa-derive-from-pq'' (\fB\s-1OSSL_PKEY_PARAM_RSA_DERIVE_FROM_PQ\s0\fR) <unsigned integer>" 4
- .IX Item "rsa-derive-from-pq (OSSL_PKEY_PARAM_RSA_DERIVE_FROM_PQ) <unsigned integer>"
- Indicate that missing parameters not passed in the parameter list should be
- derived if not provided. Setting a nonzero value will cause all
- needed exponents and coefficients to be derived if not available. Setting this
- option requires at least \s-1OSSL_PARAM_RSA_FACTOR1, OSSL_PARAM_RSA_FACTOR2,\s0
- and \s-1OSSL_PARAM_RSA_N\s0 to be provided. This option is ignored if
- \&\s-1OSSL_KEYMGMT_SELECT_PRIVATE_KEY\s0 is not set in the selection parameter.
- .SS "\s-1RSA\s0 key generation parameters for \s-1FIPS\s0 module testing"
- .IX Subsection "RSA key generation parameters for FIPS module testing"
- When generating \s-1RSA\s0 keys, the following additional key generation parameters may
- be used for algorithm testing purposes only. Do not use these to generate
- \&\s-1RSA\s0 keys for a production environment.
- .ie n .IP """xp"" (\fB\s-1OSSL_PKEY_PARAM_RSA_TEST_XP\s0\fR) <unsigned integer>" 4
- .el .IP "``xp'' (\fB\s-1OSSL_PKEY_PARAM_RSA_TEST_XP\s0\fR) <unsigned integer>" 4
- .IX Item "xp (OSSL_PKEY_PARAM_RSA_TEST_XP) <unsigned integer>"
- .PD 0
- .ie n .IP """xq"" (\fB\s-1OSSL_PKEY_PARAM_RSA_TEST_XQ\s0\fR) <unsigned integer>" 4
- .el .IP "``xq'' (\fB\s-1OSSL_PKEY_PARAM_RSA_TEST_XQ\s0\fR) <unsigned integer>" 4
- .IX Item "xq (OSSL_PKEY_PARAM_RSA_TEST_XQ) <unsigned integer>"
- .PD
- These 2 fields are normally randomly generated and are used to generate \*(L"p\*(R" and
- \&\*(L"q\*(R".
- .ie n .IP """xp1"" (\fB\s-1OSSL_PKEY_PARAM_RSA_TEST_XP1\s0\fR) <unsigned integer>" 4
- .el .IP "``xp1'' (\fB\s-1OSSL_PKEY_PARAM_RSA_TEST_XP1\s0\fR) <unsigned integer>" 4
- .IX Item "xp1 (OSSL_PKEY_PARAM_RSA_TEST_XP1) <unsigned integer>"
- .PD 0
- .ie n .IP """xp2"" (\fB\s-1OSSL_PKEY_PARAM_RSA_TEST_XP2\s0\fR) <unsigned integer>" 4
- .el .IP "``xp2'' (\fB\s-1OSSL_PKEY_PARAM_RSA_TEST_XP2\s0\fR) <unsigned integer>" 4
- .IX Item "xp2 (OSSL_PKEY_PARAM_RSA_TEST_XP2) <unsigned integer>"
- .ie n .IP """xq1"" (\fB\s-1OSSL_PKEY_PARAM_RSA_TEST_XQ1\s0\fR) <unsigned integer>" 4
- .el .IP "``xq1'' (\fB\s-1OSSL_PKEY_PARAM_RSA_TEST_XQ1\s0\fR) <unsigned integer>" 4
- .IX Item "xq1 (OSSL_PKEY_PARAM_RSA_TEST_XQ1) <unsigned integer>"
- .ie n .IP """xq2"" (\fB\s-1OSSL_PKEY_PARAM_RSA_TEST_XQ2\s0\fR) <unsigned integer>" 4
- .el .IP "``xq2'' (\fB\s-1OSSL_PKEY_PARAM_RSA_TEST_XQ2\s0\fR) <unsigned integer>" 4
- .IX Item "xq2 (OSSL_PKEY_PARAM_RSA_TEST_XQ2) <unsigned integer>"
- .PD
- These 4 fields are normally randomly generated. The prime factors \*(L"p1\*(R", \*(L"p2\*(R",
- \&\*(L"q1\*(R" and \*(L"q2\*(R" are determined from these values.
- .SS "\s-1RSA\s0 key parameters for \s-1FIPS\s0 module testing"
- .IX Subsection "RSA key parameters for FIPS module testing"
- The following intermediate values can be retrieved only if the values
- specified in \*(L"\s-1RSA\s0 key generation parameters for \s-1FIPS\s0 module testing\*(R" are set.
- These should not be accessed in a production environment.
- .ie n .IP """p1"" (\fB\s-1OSSL_PKEY_PARAM_RSA_TEST_P1\s0\fR) <unsigned integer>" 4
- .el .IP "``p1'' (\fB\s-1OSSL_PKEY_PARAM_RSA_TEST_P1\s0\fR) <unsigned integer>" 4
- .IX Item "p1 (OSSL_PKEY_PARAM_RSA_TEST_P1) <unsigned integer>"
- .PD 0
- .ie n .IP """p2"" (\fB\s-1OSSL_PKEY_PARAM_RSA_TEST_P2\s0\fR) <unsigned integer>" 4
- .el .IP "``p2'' (\fB\s-1OSSL_PKEY_PARAM_RSA_TEST_P2\s0\fR) <unsigned integer>" 4
- .IX Item "p2 (OSSL_PKEY_PARAM_RSA_TEST_P2) <unsigned integer>"
- .ie n .IP """q1"" (\fB\s-1OSSL_PKEY_PARAM_RSA_TEST_Q1\s0\fR) <unsigned integer>" 4
- .el .IP "``q1'' (\fB\s-1OSSL_PKEY_PARAM_RSA_TEST_Q1\s0\fR) <unsigned integer>" 4
- .IX Item "q1 (OSSL_PKEY_PARAM_RSA_TEST_Q1) <unsigned integer>"
- .ie n .IP """q2"" (\fB\s-1OSSL_PKEY_PARAM_RSA_TEST_Q2\s0\fR) <unsigned integer>" 4
- .el .IP "``q2'' (\fB\s-1OSSL_PKEY_PARAM_RSA_TEST_Q2\s0\fR) <unsigned integer>" 4
- .IX Item "q2 (OSSL_PKEY_PARAM_RSA_TEST_Q2) <unsigned integer>"
- .PD
- The auxiliary probable primes.
- .SS "\s-1RSA\s0 key validation"
- .IX Subsection "RSA key validation"
- For \s-1RSA\s0 keys, \fBEVP_PKEY_param_check\fR\|(3) and \fBEVP_PKEY_param_check_quick\fR\|(3)
- both return 1 unconditionally.
- .PP
- For \s-1RSA\s0 keys, \fBEVP_PKEY_public_check\fR\|(3) conforms to the SP800\-56Br1 \fIpublic key
- check\fR when the OpenSSL \s-1FIPS\s0 provider is used. The OpenSSL default provider
- performs similar tests but relaxes the keysize restrictions for backwards
- compatibility.
- .PP
- For \s-1RSA\s0 keys, \fBEVP_PKEY_public_check_quick\fR\|(3) is the same as
- \&\fBEVP_PKEY_public_check\fR\|(3).
- .PP
- For \s-1RSA\s0 keys, \fBEVP_PKEY_private_check\fR\|(3) conforms to the SP800\-56Br1
- \&\fIprivate key test\fR.
- .PP
- For \s-1RSA\s0 keys, \fBEVP_PKEY_pairwise_check\fR\|(3) conforms to the
- SP800\-56Br1 \fIKeyPair Validation check\fR for the OpenSSL \s-1FIPS\s0 provider. The
- OpenSSL default provider allows testing of the validity of multi-primes.
- .SH "CONFORMING TO"
- .IX Header "CONFORMING TO"
- .IP "\s-1FIPS186\-4\s0" 4
- .IX Item "FIPS186-4"
- Section B.3.6 Generation of Probable Primes with Conditions Based on
- Auxiliary Probable Primes
- .IP "\s-1RFC 8017,\s0 excluding RSA-PSS and RSA-OAEP" 4
- .IX Item "RFC 8017, excluding RSA-PSS and RSA-OAEP"
- .SH "EXAMPLES"
- .IX Header "EXAMPLES"
- An \fB\s-1EVP_PKEY\s0\fR context can be obtained by calling:
- .PP
- .Vb 2
- \& EVP_PKEY_CTX *pctx =
- \& EVP_PKEY_CTX_new_from_name(NULL, "RSA", NULL);
- .Ve
- .PP
- An \fB\s-1RSA\s0\fR key can be generated simply like this:
- .PP
- .Vb 1
- \& pkey = EVP_RSA_gen(4096);
- .Ve
- .PP
- or like this:
- .PP
- .Vb 3
- \& 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);
- .Ve
- .PP
- An \fB\s-1RSA\s0\fR key can be generated with key generation parameters:
- .PP
- .Vb 5
- \& 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);
- .Ve
- .SH "SEE ALSO"
- .IX Header "SEE ALSO"
- \&\fBEVP_RSA_gen\fR\|(3), \s-1\fBEVP_KEYMGMT\s0\fR\|(3), \s-1\fBEVP_PKEY\s0\fR\|(3), \fBprovider\-keymgmt\fR\|(7)
- .SH "COPYRIGHT"
- .IX Header "COPYRIGHT"
- Copyright 2020\-2024 The OpenSSL Project Authors. All Rights Reserved.
- .PP
- Licensed under the Apache License 2.0 (the \*(L"License\*(R"). You may not use
- this file except in compliance with the License. You can obtain a copy
- in the file \s-1LICENSE\s0 in the source distribution or at
- <https://www.openssl.org/source/license.html>.
|