Section 4.1 of RFC 5280 defines the contents of an x509 Certificate. Specifically, two fields are listed (signatureAlgorithm
and signature
) and defined to contain the same information: AlgorithmIdentifier
:
4.1. Basic Certificate Fields
The X.509 v3 certificate basic syntax is as follows.
Certificate ::= SEQUENCE {
tbsCertificate TBSCertificate,
signatureAlgorithm AlgorithmIdentifier, <------
signatureValue BIT STRING }
TBSCertificate ::= SEQUENCE {
version [0] EXPLICIT Version DEFAULT v1,
serialNumber CertificateSerialNumber,
signature AlgorithmIdentifier, <------
issuer Name,
validity Validity,
subject Name,
subjectPublicKeyInfo SubjectPublicKeyInfo,
<-~- truncated -~->
Later, in Section 4.1.1.2, signatureAlgorithm
is defined as:
4.1.1.2. signatureAlgorithm
The signatureAlgorithm field contains the identifier for the cryptographic algorithm used by the CA to sign this certificate. ... This field MUST contain the same algorithm identifier as the signature field in the sequence tbsCertificate (Section 4.1.2.3).
And in Section 4.1.2.3, signature
is defined as:
4.1.2.3. Signature
This field contains the algorithm identifier for the algorithm used by the CA to sign the certificate.
This field MUST contain the same algorithm identifier as the SignatureAlgorithm field in the sequence Certificate (Section 4.1.1.2).
My question is: Why must the same piece of information be listed twice?
I could understand wanting to include the Hash algorithm and Signature generation method in the Certificate Data section so it gets included with the signature verification and is therefore not susceptible to changes.
But if that is the case, why list it again between the Certificate Data and Signature sections?
I came across other questions that seem to ask the same thing, but I did not find an answer that specifically spoke to why it is listed twice. Just that it must be listed twice.