5 EVP_PKEY_CTX_set_rsa_pss_keygen_md,
6 EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md,
7 EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen
8 - EVP_PKEY RSA-PSS algorithm support functions
12 #include <openssl/rsa.h>
14 int EVP_PKEY_CTX_set_rsa_pss_keygen_md(EVP_PKEY_CTX *pctx,
16 int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(EVP_PKEY_CTX *pctx,
18 int EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(EVP_PKEY_CTX *pctx,
23 These are the functions that implement L<RSA-PSS(7)>.
25 =head2 Signing and Verification
27 The macro EVP_PKEY_CTX_set_rsa_padding() is supported but an error is
28 returned if an attempt is made to set the padding mode to anything other
29 than B<PSS>. It is otherwise similar to the B<RSA> version.
31 The EVP_PKEY_CTX_set_rsa_pss_saltlen() macro is used to set the salt length.
32 If the key has usage restrictions then an error is returned if an attempt is
33 made to set the salt length below the minimum value. It is otherwise similar
34 to the B<RSA> operation except detection of the salt length (using
35 RSA_PSS_SALTLEN_AUTO) is not supported for verification if the key has
38 The EVP_PKEY_CTX_set_signature_md() and EVP_PKEY_CTX_set_rsa_mgf1_md() macros
39 are used to set the digest and MGF1 algorithms respectively. If the key has
40 usage restrictions then an error is returned if an attempt is made to set the
41 digest to anything other than the restricted value. Otherwise these are
42 similar to the B<RSA> versions.
46 As with RSA key generation the EVP_PKEY_CTX_set_rsa_keygen_bits()
47 and EVP_PKEY_CTX_set_rsa_keygen_pubexp() macros are supported for RSA-PSS:
48 they have exactly the same meaning as for the RSA algorithm.
50 Optional parameter restrictions can be specified when generating a PSS key.
51 If any restrictions are set (using the macros described below) then B<all>
52 parameters are restricted. For example, setting a minimum salt length also
53 restricts the digest and MGF1 algorithms. If any restrictions are in place
54 then they are reflected in the corresponding parameters of the public key
55 when (for example) a certificate request is signed.
57 EVP_PKEY_CTX_set_rsa_pss_keygen_md() restricts the digest algorithm the
58 generated key can use to B<md>.
60 EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md() restricts the MGF1 algorithm the
61 generated key can use to B<md>.
63 EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen() restricts the minimum salt length
68 A context for the B<RSA-PSS> algorithm can be obtained by calling:
70 EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA_PSS, NULL);
74 All these functions return 1 for success and 0 or a negative value for failure.
75 In particular a return value of -2 indicates the operation is not supported by
76 the public key algorithm.
81 L<EVP_PKEY_CTX_new(3)>,
82 L<EVP_PKEY_CTX_ctrl_str(3)>,
87 Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
89 Licensed under the OpenSSL license (the "License"). You may not use
90 this file except in compliance with the License. You can obtain a copy
91 in the file LICENSE in the source distribution or at
92 L<https://www.openssl.org/source/license.html>.