Signatures are used in a number of different ASN.1 structures. As shown in the ASN.1 representation from [
RFC 5280] below, in an X.509 certificate, a signature is encoded with an algorithm identifier in the signatureAlgorithm attribute and a signatureValue attribute that contains the actual signature.
Certificate ::= SEQUENCE {
tbsCertificate TBSCertificate,
signatureAlgorithm AlgorithmIdentifier,
signatureValue BIT STRING }
The identifiers defined in
Section 3 can be used as the AlgorithmIdentifier in the signatureAlgorithm field in the sequence Certificate and the signature field in the sequence TBSCertificate in X.509 [
RFC 5280]. The parameters of these signature algorithms are absent, as explained in
Section 3.
Conforming Certification Authority (CA) implementations
MUST specify the algorithms explicitly by using the OIDs specified in
Section 3 when encoding RSASSA-PSS or ECDSA with SHAKE signatures in certificates and CRLs. Conforming client implementations that process certificates and CRLs using RSASSA-PSS or ECDSA with SHAKE
MUST recognize the corresponding OIDs. Encoding rules for RSASSA-PSS and ECDSA signature values are specified in [
RFC 4055] and [
RFC 5480], respectively.
When using RSASSA-PSS or ECDSA with SHAKEs, the RSA modulus and ECDSA curve order
SHOULD be chosen in line with the SHAKE output length. Refer to
Section 6 for more details.
The RSASSA-PSS algorithm is defined in [
RFC 8017]. When id-RSASSA-PSS-SHAKE128 or id-RSASSA-PSS-SHAKE256 (specified in
Section 3) is used, the encoding
MUST omit the parameters field. That is, the AlgorithmIdentifier
SHALL be a SEQUENCE of one component: id-RSASSA-PSS-SHAKE128 or id-RSASSA-PSS-SHAKE256. [
RFC 4055] defines RSASSA-PSS-params that is used to define the algorithms and inputs to the algorithm. This specification does not use parameters because the hash, mask generation algorithm, trailer, and salt are embedded in the OID definition.
The hash algorithm to hash a message being signed and the hash algorithm used as the MGF in RSASSA-PSS
MUST be the same: both SHAKE128 or both SHAKE256. The output length of the hash algorithm that hashes the message
SHALL be 32 bytes (for SHAKE128) or 64 bytes (for SHAKE256).
The MGF takes an octet string of variable length and a desired output length as input and outputs an octet string of the desired length. In RSASSA-PSS with SHAKEs, the SHAKEs
MUST be used natively as the MGF, instead of the MGF1 algorithm that uses the hash function in multiple iterations, as specified in
Appendix B.2.1 of
RFC 8017. In other words, the MGF is defined as the SHAKE128 or SHAKE256 output of the mgfSeed for id-RSASSA-PSS-SHAKE128 and id-RSASSA-PSS-SHAKE256, respectively. The mgfSeed is the seed from which the mask is generated, an octet string [
RFC 8017]. As explained in Step 9 of
Section 9.1.1 of
RFC 8017, the output length of the MGF is emLen - hLen - 1 bytes. emLen is the maximum message length ceil((n-1)/8), where n is the RSA modulus in bits. hLen is 32 and 64 bytes for id-RSASSA-PSS-SHAKE128 and id-RSASSA-PSS-SHAKE256, respectively. Thus, when SHAKE is used as the MGF, the SHAKE output length maskLen is (8*emLen - 264) or (8*emLen - 520) bits, respectively. For example, when RSA modulus n is 2048 bits, the output length of SHAKE128 or SHAKE256 as the MGF will be 1784 or 1528 bits when id-RSASSA-PSS-SHAKE128 or id-RSASSA-PSS-SHAKE256 is used, respectively.
The RSASSA-PSS saltLength
MUST be 32 bytes for id-RSASSA-PSS-SHAKE128 or 64 bytes for id-RSASSA-PSS-SHAKE256. Finally, the trailerField
MUST be 1, which represents the trailer field with hexadecimal value 0xBC [
RFC 8017].
The Elliptic Curve Digital Signature Algorithm (ECDSA) is defined in [
X9.62]. When the id-ecdsa-with-shake128 or id-ecdsa-with-shake256 (specified in
Section 3) algorithm identifier appears, the respective SHAKE function (SHAKE128 or SHAKE256) is used as the hash. The encoding
MUST omit the parameters field. That is, the AlgorithmIdentifier
SHALL be a SEQUENCE of one component: the OID id-ecdsa-with-shake128 or id-ecdsa-with-shake256.
For simplicity and compliance with the ECDSA standard specification [
X9.62], the output length of the hash function must be explicitly determined. The output length, d, for SHAKE128 or SHAKE256 used in ECDSA
MUST be 256 or 512 bits, respectively.
Conforming CA implementations that generate ECDSA with SHAKE signatures in certificates or CRLs
SHOULD generate such signatures with a deterministically generated, nonrandom k in accordance with all the requirements specified in [
RFC 6979]. They
MAY also generate such signatures in accordance with all other recommendations in [
X9.62] or [
SEC1] if they have a stated policy that requires conformance to those standards. Those standards have not specified SHAKE128 and SHAKE256 as hash algorithm options. However, SHAKE128 and SHAKE256 with output length being 32 and 64 octets, respectively, can be used instead of 256- and 512-bit output hash algorithms such as SHA256 and SHA512.
Certificates conforming to [
RFC 5280] can convey a public key for any public key algorithm. The certificate indicates the public key algorithm through an algorithm identifier. This algorithm identifier is an OID with optionally associated parameters. The conventions and encoding for RSASSA-PSS and ECDSA public key algorithm identifiers are as specified in Sections
2.3.1 and
2.3.5 of [
RFC 3279],
Section 3.1 of
RFC 4055 and
Section 2.1 of
RFC 5480.
Traditionally, the rsaEncryption object identifier is used to identify RSA public keys. The rsaEncryption object identifier continues to identify the subject public key when the RSA private key owner does not wish to limit the use of the public key exclusively to RSASSA-PSS with SHAKEs. When the RSA private key owner wishes to limit the use of the public key exclusively to RSASSA-PSS with SHAKEs, the AlgorithmIdentifiers for RSASSA-PSS defined in
Section 3 SHOULD be used as the algorithm field in the SubjectPublicKeyInfo sequence [
RFC 5280]. Conforming client implementations that process RSASSA-PSS with SHAKE public keys when processing certificates and CRLs
MUST recognize the corresponding OIDs.
Conforming CA implementations
MUST specify the X.509 public key algorithm explicitly by using the OIDs specified in
Section 3 when encoding ECDSA with SHAKE public keys in certificates and CRLs. Conforming client implementations that process ECDSA with SHAKE public keys when processing certificates and CRLs
MUST recognize the corresponding OIDs.
The identifier parameters, as explained in
Section 3,
MUST be absent.