| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" ======================================================================== |
| 56 |
.\" |
| 57 |
.IX Title "EVP_PKEY_CTX_SET_RSA_PSS_KEYGEN_MD 3SSL" |
| 58 |
.TH EVP_PKEY_CTX_SET_RSA_PSS_KEYGEN_MD 3SSL 2026-04-07 3.6.2 OpenSSL |
| 59 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 60 |
.\" way too many mistakes in technical documents. |
| 61 |
.if n .ad l |
| 62 |
.nh |
| 63 |
.SH NAME |
| 64 |
EVP_PKEY_CTX_set_rsa_pss_keygen_md, |
| 65 |
EVP_PKEY_CTX_set_rsa_pss_keygen_md_name, |
| 66 |
EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md, |
| 67 |
EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md_name, |
| 68 |
EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen |
| 69 |
\&\- EVP_PKEY RSA\-PSS algorithm support functions |
| 70 |
.SH SYNOPSIS |
| 71 |
.IX Header "SYNOPSIS" |
| 72 |
.Vb 1 |
| 73 |
\& #include <openssl/rsa.h> |
| 74 |
\& |
| 75 |
\& int EVP_PKEY_CTX_set_rsa_pss_keygen_md(EVP_PKEY_CTX *pctx, |
| 76 |
\& const EVP_MD *md); |
| 77 |
\& int EVP_PKEY_CTX_set_rsa_pss_keygen_md_name(EVP_PKEY_CTX *ctx, |
| 78 |
\& const char *mdname, |
| 79 |
\& const char *mdprops); |
| 80 |
\& int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(EVP_PKEY_CTX *pctx, |
| 81 |
\& const EVP_MD *md); |
| 82 |
\& int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md_name(EVP_PKEY_CTX *pctx, |
| 83 |
\& const char *mdname); |
| 84 |
\& int EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(EVP_PKEY_CTX *pctx, |
| 85 |
\& int saltlen); |
| 86 |
.Ve |
| 87 |
.SH DESCRIPTION |
| 88 |
.IX Header "DESCRIPTION" |
| 89 |
These are the functions that implement \fBRSA\-PSS\fR\|(7). |
| 90 |
.SS "Signing and Verification" |
| 91 |
.IX Subsection "Signing and Verification" |
| 92 |
The macro \fBEVP_PKEY_CTX_set_rsa_padding()\fR is supported but an error is |
| 93 |
returned if an attempt is made to set the padding mode to anything other |
| 94 |
than \fBPSS\fR. It is otherwise similar to the \fBRSA\fR version. |
| 95 |
.PP |
| 96 |
The \fBEVP_PKEY_CTX_set_rsa_pss_saltlen()\fR macro is used to set the salt length. |
| 97 |
If the key has usage restrictions then an error is returned if an attempt is |
| 98 |
made to set the salt length below the minimum value. It is otherwise similar |
| 99 |
to the \fBRSA\fR operation except detection of the salt length (using |
| 100 |
RSA_PSS_SALTLEN_AUTO) is not supported for verification if the key has |
| 101 |
usage restrictions. |
| 102 |
.PP |
| 103 |
The \fBEVP_PKEY_CTX_set_signature_md\fR\|(3) and \fBEVP_PKEY_CTX_set_rsa_mgf1_md\fR\|(3) |
| 104 |
functions are used to set the digest and MGF1 algorithms respectively. If the |
| 105 |
key has usage restrictions then an error is returned if an attempt is made to |
| 106 |
set the digest to anything other than the restricted value. Otherwise these are |
| 107 |
similar to the \fBRSA\fR versions. |
| 108 |
.SS "Key Generation" |
| 109 |
.IX Subsection "Key Generation" |
| 110 |
As with RSA key generation the \fBEVP_PKEY_CTX_set_rsa_keygen_bits()\fR |
| 111 |
and \fBEVP_PKEY_CTX_set_rsa_keygen_pubexp()\fR macros are supported for RSA-PSS: |
| 112 |
they have exactly the same meaning as for the RSA algorithm. |
| 113 |
.PP |
| 114 |
Optional parameter restrictions can be specified when generating a PSS key. |
| 115 |
If any restrictions are set (using the macros described below) then \fBall\fR |
| 116 |
parameters are restricted. For example, setting a minimum salt length also |
| 117 |
restricts the digest and MGF1 algorithms. If any restrictions are in place |
| 118 |
then they are reflected in the corresponding parameters of the public key |
| 119 |
when (for example) a certificate request is signed. |
| 120 |
.PP |
| 121 |
\&\fBEVP_PKEY_CTX_set_rsa_pss_keygen_md()\fR restricts the digest algorithm the |
| 122 |
generated key can use to \fImd\fR. |
| 123 |
\&\fBEVP_PKEY_CTX_set_rsa_pss_keygen_md_name()\fR does the same thing, but |
| 124 |
passes the algorithm by name rather than by \fBEVP_MD\fR. |
| 125 |
.PP |
| 126 |
\&\fBEVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md()\fR restricts the MGF1 algorithm the |
| 127 |
generated key can use to \fImd\fR. |
| 128 |
\&\fBEVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md_name()\fR does the same thing, but |
| 129 |
passes the algorithm by name rather than by \fBEVP_MD\fR. |
| 130 |
.PP |
| 131 |
\&\fBEVP_PKEY_CTX_set_rsa_pss_keygen_saltlen()\fR restricts the minimum salt length |
| 132 |
to \fIsaltlen\fR. |
| 133 |
.SH NOTES |
| 134 |
.IX Header "NOTES" |
| 135 |
A context for the \fBRSA-PSS\fR algorithm can be obtained by calling: |
| 136 |
.PP |
| 137 |
.Vb 1 |
| 138 |
\& EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA_PSS, NULL); |
| 139 |
.Ve |
| 140 |
.SH "RETURN VALUES" |
| 141 |
.IX Header "RETURN VALUES" |
| 142 |
All these functions return 1 for success and 0 or a negative value for failure. |
| 143 |
In particular a return value of \-2 indicates the operation is not supported by |
| 144 |
the public key algorithm. |
| 145 |
.SH "SEE ALSO" |
| 146 |
.IX Header "SEE ALSO" |
| 147 |
\&\fBRSA\-PSS\fR\|(7), |
| 148 |
\&\fBEVP_PKEY_CTX_new\fR\|(3), |
| 149 |
\&\fBEVP_PKEY_CTX_ctrl_str\fR\|(3), |
| 150 |
\&\fBEVP_PKEY_derive\fR\|(3) |
| 151 |
.SH COPYRIGHT |
| 152 |
.IX Header "COPYRIGHT" |
| 153 |
Copyright 2017\-2021 The OpenSSL Project Authors. All Rights Reserved. |
| 154 |
.PP |
| 155 |
Licensed under the Apache License 2.0 (the "License"). You may not use |
| 156 |
this file except in compliance with the License. You can obtain a copy |
| 157 |
in the file LICENSE in the source distribution or at |
| 158 |
<https://www.openssl.org/source/license.html>. |