1 1.1 christos =pod 2 1.1 christos 3 1.1 christos =head1 NAME 4 1.1 christos 5 1.1 christos EVP_SIGNATURE-RSA 6 1.1.1.2 christos - The EVP_PKEY B<RSA> signature implementation 7 1.1 christos 8 1.1 christos =head1 DESCRIPTION 9 1.1 christos 10 1.1 christos Support for computing RSA signatures. 11 1.1 christos See L<EVP_PKEY-RSA(7)> for information related to RSA keys. 12 1.1 christos 13 1.1 christos =head2 Algorithm Names 14 1.1 christos 15 1.1 christos In this list, names are grouped together to signify that they are the same 16 1.1 christos algorithm having multiple names. This also includes the OID in canonical 17 1.1 christos decimal form (which means that they are possible to fetch if the caller has a 18 1.1 christos mere OID which came out in this form after a call to L<OBJ_obj2txt(3)>). 19 1.1 christos 20 1.1 christos =over 4 21 1.1 christos 22 1.1 christos =item "RSA", "rsaEncryption", "1.2.840.113549.1.1.1" 23 1.1 christos 24 1.1 christos The base signature algorithm, supported explicitly fetched with 25 1.1 christos L<EVP_PKEY_sign_init_ex2(3)>, and implicitly fetched (through 26 1.1 christos L<RSA keys|EVP_PKEY-RSA(7)>) with L<EVP_DigestSignInit(3)> and 27 1.1 christos L<EVP_DigestVerifyInit(3)>. 28 1.1 christos 29 1.1 christos It can't be used with L<EVP_PKEY_sign_message_init(3)> 30 1.1 christos 31 1.1 christos =item "RSA-RIPEMD160", "ripemd160WithRSA", "1.3.36.3.3.1.2" 32 1.1 christos 33 1.1 christos =item "RSA-SHA2-256", "RSA-SHA256", "sha256WithRSAEncryption", "1.2.840.113549.1.1.11" 34 1.1 christos 35 1.1 christos =item "RSA-SHA2-384", "RSA-SHA384", "sha384WithRSAEncryption", "1.2.840.113549.1.1.12" 36 1.1 christos 37 1.1 christos =item "RSA-SHA2-512", "RSA-SHA512", "sha512WithRSAEncryption", "1.2.840.113549.1.1.13" 38 1.1 christos 39 1.1 christos =item "RSA-SHA2-224", "RSA-SHA224", "sha224WithRSAEncryption", "1.2.840.113549.1.1.14" 40 1.1 christos 41 1.1 christos =item "RSA-SHA2-512/224", "RSA-SHA512-224", "sha512-224WithRSAEncryption", "1.2.840.113549.1.1.15" 42 1.1 christos 43 1.1 christos =item "RSA-SHA2-512/256", "RSA-SHA512-256", "sha512-256WithRSAEncryption", "1.2.840.113549.1.1.16" 44 1.1 christos 45 1.1 christos =item "RSA-SHA3-224", "id-rsassa-pkcs1-v1_5-with-sha3-224", "2.16.840.1.101.3.4.3.13" 46 1.1 christos 47 1.1 christos =item "RSA-SHA3-256", "id-rsassa-pkcs1-v1_5-with-sha3-256", "2.16.840.1.101.3.4.3.14" 48 1.1 christos 49 1.1 christos =item "RSA-SHA3-384", "id-rsassa-pkcs1-v1_5-with-sha3-384", "2.16.840.1.101.3.4.3.15" 50 1.1 christos 51 1.1 christos =item "RSA-SHA3-512", "id-rsassa-pkcs1-v1_5-with-sha3-512", "2.16.840.1.101.3.4.3.16" 52 1.1 christos 53 1.1 christos =item "RSA-SM3", "sm3WithRSAEncryption", "1.2.156.10197.1.504" 54 1.1 christos 55 1.1 christos PKCS#1 v1.5 RSA signature schemes with diverse message digest algorithms. They 56 1.1 christos are all supported explicitly fetched with L<EVP_PKEY_sign_init_ex2(3)> and 57 1.1 christos L<EVP_PKEY_sign_message_init(3)>. 58 1.1 christos They are all pre-set to use the pad mode "pkcs1". This cannot be changed. 59 1.1 christos 60 1.1 christos =back 61 1.1 christos 62 1.1 christos =head2 Signature Parameters 63 1.1 christos 64 1.1 christos The following signature parameters can be set using EVP_PKEY_CTX_set_params(). 65 1.1 christos This may be called after EVP_PKEY_sign_init() or EVP_PKEY_verify_init(), 66 1.1 christos and before calling EVP_PKEY_sign() or EVP_PKEY_verify(). They may also be set 67 1.1 christos using EVP_PKEY_sign_init_ex() or EVP_PKEY_verify_init_ex(). 68 1.1 christos 69 1.1 christos =over 4 70 1.1 christos 71 1.1 christos =item "digest" (B<OSSL_SIGNATURE_PARAM_DIGEST>) <UTF8 string> 72 1.1 christos 73 1.1 christos =item "properties" (B<OSSL_SIGNATURE_PARAM_PROPERTIES>) <UTF8 string> 74 1.1 christos 75 1.1 christos These are not supported with the RSA signature schemes that already include a 76 1.1 christos message digest algorithm, See L</Algorithm Names> above. 77 1.1 christos 78 1.1 christos These common parameters are described in L<provider-signature(7)>. 79 1.1 christos 80 1.1 christos =item "pad-mode" (B<OSSL_SIGNATURE_PARAM_PAD_MODE>) <UTF8 string> 81 1.1 christos 82 1.1 christos The type of padding to be used. Its value can be one of the following: 83 1.1 christos 84 1.1 christos =over 4 85 1.1 christos 86 1.1 christos =item "none" (B<OSSL_PKEY_RSA_PAD_MODE_NONE>) 87 1.1 christos 88 1.1 christos =item "pkcs1" (B<OSSL_PKEY_RSA_PAD_MODE_PKCSV15>) 89 1.1 christos 90 1.1 christos =item "x931" (B<OSSL_PKEY_RSA_PAD_MODE_X931>) 91 1.1 christos 92 1.1 christos This padding mode is no longer supported by the FIPS provider for signature 93 1.1 christos generation, but may be used for signature verification for legacy use cases. 94 1.1 christos (This is a FIPS 140-3 requirement) 95 1.1 christos 96 1.1 christos =item "pss" (B<OSSL_PKEY_RSA_PAD_MODE_PSS>) 97 1.1 christos 98 1.1 christos =back 99 1.1 christos 100 1.1 christos =item "mgf1-digest" (B<OSSL_SIGNATURE_PARAM_MGF1_DIGEST>) <UTF8 string> 101 1.1 christos 102 1.1 christos The digest algorithm name to use for the maskGenAlgorithm used by "pss" mode. 103 1.1 christos 104 1.1 christos =item "mgf1-properties" (B<OSSL_SIGNATURE_PARAM_MGF1_PROPERTIES>) <UTF8 string> 105 1.1 christos 106 1.1 christos Sets the name of the property query associated with the "mgf1-digest" algorithm. 107 1.1 christos NULL is used if this optional value is not set. 108 1.1 christos 109 1.1 christos =item "saltlen" (B<OSSL_SIGNATURE_PARAM_PSS_SALTLEN>) <integer> or <UTF8 string> 110 1.1 christos 111 1.1 christos The "pss" mode minimum salt length. The value can either be an integer, 112 1.1 christos a string value representing a number or one of the following string values: 113 1.1 christos 114 1.1 christos =over 4 115 1.1 christos 116 1.1 christos =item "digest" (B<OSSL_PKEY_RSA_PSS_SALT_LEN_DIGEST>) 117 1.1 christos 118 1.1 christos Use the same length as the digest size. 119 1.1 christos 120 1.1 christos =item "max" (B<OSSL_PKEY_RSA_PSS_SALT_LEN_MAX>) 121 1.1 christos 122 1.1 christos Use the maximum salt length. 123 1.1 christos 124 1.1 christos =item "auto" (B<OSSL_PKEY_RSA_PSS_SALT_LEN_AUTO>) 125 1.1 christos 126 1.1 christos Auto detect the salt length. 127 1.1 christos 128 1.1 christos =item "auto-digestmax" (B<OSSL_PKEY_RSA_PSS_SALT_LEN_AUTO_DIGEST_MAX>) 129 1.1 christos 130 1.1 christos Auto detect the salt length when verifying. Maximize the salt length up to the 131 1.1 christos digest size when signing to comply with FIPS 186-4 section 5.5. 132 1.1 christos 133 1.1 christos =back 134 1.1 christos 135 1.1 christos =back 136 1.1 christos 137 1.1 christos The OpenSSL FIPS provider also supports the following parameters: 138 1.1 christos 139 1.1 christos =over 4 140 1.1 christos 141 1.1 christos =item "key-check" (B<OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK>) <integer> 142 1.1 christos 143 1.1 christos =item "digest-check" (B<OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK>) <integer> 144 1.1 christos 145 1.1 christos =item "sign-x931-pad-check" (B<OSSL_SIGNATURE_PARAM_FIPS_SIGN_X931_PAD_CHECK>) <integer> 146 1.1 christos 147 1.1 christos These parameters are described in L<provider-signature(7)>. 148 1.1 christos 149 1.1 christos =item "rsa-pss-saltlen-check" (B<OSSL_SIGNATURE_PARAM_FIPS_RSA_PSS_SALTLEN_CHECK>) <integer> 150 1.1 christos 151 1.1 christos The default value of 1 causes an error during signature generation or 152 1.1 christos verification if salt length (B<OSSL_SIGNATURE_PARAM_PSS_SALTLEN>) is not between 153 1.1 christos zero and the output block size of the digest function (inclusive). 154 1.1 christos Setting this to zero will ignore the error and set the approved "fips-indicator" 155 1.1 christos to 0. 156 1.1 christos This option breaks FIPS compliance if it causes the approved "fips-indicator" 157 1.1 christos to return 0. 158 1.1 christos 159 1.1 christos =back 160 1.1 christos 161 1.1 christos The following signature parameters can be retrieved using 162 1.1 christos EVP_PKEY_CTX_get_params(). 163 1.1 christos 164 1.1 christos =over 4 165 1.1 christos 166 1.1 christos =item "algorithm-id" (B<OSSL_SIGNATURE_PARAM_ALGORITHM_ID>) <octet string> 167 1.1 christos 168 1.1 christos =item "fips-indicator" (B<OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR>) <integer> 169 1.1 christos 170 1.1 christos =item "verify-message" (B<OSSL_SIGNATURE_PARAM_FIPS_VERIFY_MESSAGE> <integer> 171 1.1 christos 172 1.1 christos These common parameter are described in L<provider-signature(7)>. 173 1.1 christos 174 1.1 christos =item "digest" (B<OSSL_SIGNATURE_PARAM_DIGEST>) <UTF8 string> 175 1.1 christos 176 1.1 christos =item "pad-mode" (B<OSSL_SIGNATURE_PARAM_PAD_MODE>) <UTF8 string> 177 1.1 christos 178 1.1 christos =item "mgf1-digest" (B<OSSL_SIGNATURE_PARAM_MGF1_DIGEST>) <UTF8 string> 179 1.1 christos 180 1.1 christos =item "saltlen" (B<OSSL_SIGNATURE_PARAM_PSS_SALTLEN>) <integer> or <UTF8 string> 181 1.1 christos 182 1.1 christos These parameters are as described above. 183 1.1 christos 184 1.1 christos =back 185 1.1 christos 186 1.1 christos =head1 SEE ALSO 187 1.1 christos 188 1.1 christos L<EVP_PKEY_CTX_set_params(3)>, 189 1.1 christos L<EVP_PKEY_sign(3)>, 190 1.1 christos L<EVP_PKEY_verify(3)>, 191 1.1 christos L<provider-signature(7)>, 192 1.1 christos 193 1.1 christos =head1 COPYRIGHT 194 1.1 christos 195 1.1.1.2 christos Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved. 196 1.1 christos 197 1.1 christos Licensed under the Apache License 2.0 (the "License"). You may not use 198 1.1 christos this file except in compliance with the License. You can obtain a copy 199 1.1 christos in the file LICENSE in the source distribution or at 200 1.1 christos L<https://www.openssl.org/source/license.html>. 201 1.1 christos 202 1.1 christos =cut 203