5 EVP_PKEY_CTX_set_rsa_pss_keygen_md,
6 EVP_PKEY_CTX_set_rsa_pss_keygen_md_name,
7 EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md,
8 EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md_name,
9 EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen
10 - EVP_PKEY RSA-PSS algorithm support functions
14 #include <openssl/rsa.h>
16 int EVP_PKEY_CTX_set_rsa_pss_keygen_md(EVP_PKEY_CTX *pctx,
18 int EVP_PKEY_CTX_set_rsa_pss_keygen_md_name(EVP_PKEY_CTX *ctx,
21 int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(EVP_PKEY_CTX *pctx,
23 int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md_name(EVP_PKEY_CTX *pctx,
25 int EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(EVP_PKEY_CTX *pctx,
30 These are the functions that implement L<RSA-PSS(7)>.
32 =head2 Signing and Verification
34 The macro EVP_PKEY_CTX_set_rsa_padding() is supported but an error is
35 returned if an attempt is made to set the padding mode to anything other
36 than B<PSS>. It is otherwise similar to the B<RSA> version.
38 The EVP_PKEY_CTX_set_rsa_pss_saltlen() macro is used to set the salt length.
39 If the key has usage restrictions then an error is returned if an attempt is
40 made to set the salt length below the minimum value. It is otherwise similar
41 to the B<RSA> operation except detection of the salt length (using
42 RSA_PSS_SALTLEN_AUTO) is not supported for verification if the key has
45 The L<EVP_PKEY_CTX_set_signature_md(3)> and L<EVP_PKEY_CTX_set_rsa_mgf1_md(3)>
46 functions are used to set the digest and MGF1 algorithms respectively. If the
47 key has usage restrictions then an error is returned if an attempt is made to
48 set the digest to anything other than the restricted value. Otherwise these are
49 similar to the B<RSA> versions.
53 As with RSA key generation the EVP_PKEY_CTX_set_rsa_keygen_bits()
54 and EVP_PKEY_CTX_set_rsa_keygen_pubexp() macros are supported for RSA-PSS:
55 they have exactly the same meaning as for the RSA algorithm.
57 Optional parameter restrictions can be specified when generating a PSS key.
58 If any restrictions are set (using the macros described below) then B<all>
59 parameters are restricted. For example, setting a minimum salt length also
60 restricts the digest and MGF1 algorithms. If any restrictions are in place
61 then they are reflected in the corresponding parameters of the public key
62 when (for example) a certificate request is signed.
64 EVP_PKEY_CTX_set_rsa_pss_keygen_md() restricts the digest algorithm the
65 generated key can use to I<md>.
66 EVP_PKEY_CTX_set_rsa_pss_keygen_md_name() does the same thing, but
67 passes the algorithm by name rather than by B<EVP_MD>.
69 EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md() restricts the MGF1 algorithm the
70 generated key can use to I<md>.
71 EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md_name() does the same thing, but
72 passes the algorithm by name rather than by B<EVP_MD>.
74 EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen() restricts the minimum salt length
79 A context for the B<RSA-PSS> algorithm can be obtained by calling:
81 EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA_PSS, NULL);
85 All these functions return 1 for success and 0 or a negative value for failure.
86 In particular a return value of -2 indicates the operation is not supported by
87 the public key algorithm.
92 L<EVP_PKEY_CTX_new(3)>,
93 L<EVP_PKEY_CTX_ctrl_str(3)>,
98 Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
100 Licensed under the Apache License 2.0 (the "License"). You may not use
101 this file except in compliance with the License. You can obtain a copy
102 in the file LICENSE in the source distribution or at
103 L<https://www.openssl.org/source/license.html>.