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