=pod =head1 NAME EVP_SIGNATURE-RSA - The EVP_PKEY RSA signature implementation =head1 DESCRIPTION Support for computing RSA signatures. See L for information related to RSA keys. =head2 Algorithm Names In this list, names are grouped together to signify that they are the same algorithm having multiple names. This also includes the OID in canonical decimal form (which means that they are possible to fetch if the caller has a mere OID which came out in this form after a call to L). =over 4 =item "RSA", "rsaEncryption", "1.2.840.113549.1.1.1" The base signature algorithm, supported explicitly fetched with L, and implicitly fetched (through L) with L and L. It can't be used with L =item "RSA-RIPEMD160", "ripemd160WithRSA", "1.3.36.3.3.1.2" =item "RSA-SHA2-256", "RSA-SHA256", "sha256WithRSAEncryption", "1.2.840.113549.1.1.11" =item "RSA-SHA2-384", "RSA-SHA384", "sha384WithRSAEncryption", "1.2.840.113549.1.1.12" =item "RSA-SHA2-512", "RSA-SHA512", "sha512WithRSAEncryption", "1.2.840.113549.1.1.13" =item "RSA-SHA2-224", "RSA-SHA224", "sha224WithRSAEncryption", "1.2.840.113549.1.1.14" =item "RSA-SHA2-512/224", "RSA-SHA512-224", "sha512-224WithRSAEncryption", "1.2.840.113549.1.1.15" =item "RSA-SHA2-512/256", "RSA-SHA512-256", "sha512-256WithRSAEncryption", "1.2.840.113549.1.1.16" =item "RSA-SHA3-224", "id-rsassa-pkcs1-v1_5-with-sha3-224", "2.16.840.1.101.3.4.3.13" =item "RSA-SHA3-256", "id-rsassa-pkcs1-v1_5-with-sha3-256", "2.16.840.1.101.3.4.3.14" =item "RSA-SHA3-384", "id-rsassa-pkcs1-v1_5-with-sha3-384", "2.16.840.1.101.3.4.3.15" =item "RSA-SHA3-512", "id-rsassa-pkcs1-v1_5-with-sha3-512", "2.16.840.1.101.3.4.3.16" =item "RSA-SM3", "sm3WithRSAEncryption", "1.2.156.10197.1.504" PKCS#1 v1.5 RSA signature schemes with diverse message digest algorithms. They are all supported explicitly fetched with L and L. They are all pre-set to use the pad mode "pkcs1". This cannot be changed. =back =head2 Signature Parameters The following signature parameters can be set using EVP_PKEY_CTX_set_params(). This may be called after EVP_PKEY_sign_init() or EVP_PKEY_verify_init(), and before calling EVP_PKEY_sign() or EVP_PKEY_verify(). They may also be set using EVP_PKEY_sign_init_ex() or EVP_PKEY_verify_init_ex(). =over 4 =item "digest" (B) =item "properties" (B) These are not supported with the RSA signature schemes that already include a message digest algorithm, See L above. These common parameters are described in L. =item "pad-mode" (B) The type of padding to be used. Its value can be one of the following: =over 4 =item "none" (B) =item "pkcs1" (B) =item "x931" (B) This padding mode is no longer supported by the FIPS provider for signature generation, but may be used for signature verification for legacy use cases. (This is a FIPS 140-3 requirement) =item "pss" (B) =back =item "mgf1-digest" (B) The digest algorithm name to use for the maskGenAlgorithm used by "pss" mode. =item "mgf1-properties" (B) Sets the name of the property query associated with the "mgf1-digest" algorithm. NULL is used if this optional value is not set. =item "saltlen" (B) or The "pss" mode minimum salt length. The value can either be an integer, a string value representing a number or one of the following string values: =over 4 =item "digest" (B) Use the same length as the digest size. =item "max" (B) Use the maximum salt length. =item "auto" (B) Auto detect the salt length. =item "auto-digestmax" (B) Auto detect the salt length when verifying. Maximize the salt length up to the digest size when signing to comply with FIPS 186-4 section 5.5. =back =back The OpenSSL FIPS provider also supports the following parameters: =over 4 =item "key-check" (B) =item "digest-check" (B) =item "sign-x931-pad-check" (B) These parameters are described in L. =item "rsa-pss-saltlen-check" (B) The default value of 1 causes an error during signature generation or verification if salt length (B) is not between zero and the output block size of the digest function (inclusive). Setting this to zero will ignore the error and set the approved "fips-indicator" to 0. This option breaks FIPS compliance if it causes the approved "fips-indicator" to return 0. =back The following signature parameters can be retrieved using EVP_PKEY_CTX_get_params(). =over 4 =item "algorithm-id" (B) =item "fips-indicator" (B) =item "verify-message" (B These common parameter are described in L. =item "digest" (B) =item "pad-mode" (B) =item "mgf1-digest" (B) =item "saltlen" (B) or These parameters are as described above. =back =head1 SEE ALSO L, L, L, L, =head1 COPYRIGHT Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved. Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at L. =cut