rfc-3275

(Extensible Markup Language) XML-Signature Syntax and Processing

D. Eastlake 3rd, J. Reagle, D. Solo
date2002-03 streamIETF areasec wgxmldsig statusDRAFT STANDARD pages73 canonicalhttps://www.rfc-editor.org/rfc/rfc3275 doi10.17487/RFC3275 errataview
This document specifies XML (Extensible Markup Language) digital signature processing rules and syntax. [STANDARDS-TRACK]

obsoletes

Extracted elements (30)

design-rationale §2.1

KeyInfo is outside SignedInfo and is therefore optional, for two reasons: the signer may not wish to reveal key information to all parties, and the information may be known from application context. Applications that want to bind key information to the signature can include a Reference to KeyInfo from within SignedInfo.

security, crypto

design-rationale §1.3

No explicit version number is included in the XML Signature syntax; if a future version is needed, it will use a different namespace URI. This avoids version negotiation complexity while allowing clean evolution.

security, crypto

design-rationale §2.3

The Manifest element exists to allow applications to reserve reference validation logic for themselves: a single SignedInfo can reference one Manifest containing many References, avoiding expensive repeated public-key signature operations over large SignedInfo elements when multiple signatures on the same document set are required.

security, crypto

design-rationale §4.3.3.2

Use of fragment identifiers in the URI attribute is NOT RECOMMENDED because fragment processing by a proxy may not be standardized, causing reference validation failures. Instead, XPath Transforms are recommended for selecting XML subtrees.

security, crypto

interoperability-note §4.3.1

Applications using Canonical XML with Comments (section 6.5.1) or minimal canonicalization alternatives will not interoperate with applications that do not support the specified algorithm. Non-required canonicalization algorithms may also introduce security issues in entity and comment processing.

security, crypto

interoperability-note §3.2

Comparison of digest and signature values during validation MUST be over the numeric or decoded octet sequence, not the encoded string, because different implementations may produce different base64 encodings (e.g., accidental whitespace differences) of the same underlying value.

security, crypto

normative-requirement §4.1 MUST

Implementations MUST generate laxly schema valid Signature elements as specified by the schema. The Signature element is the root element of an XML Signature and contains SignedInfo, SignatureValue, optional KeyInfo, and zero or more Object elements.

security, crypto

normative-requirement §6.1 MUST

Implementations MUST support the REQUIRED canonicalization algorithm (Canonical XML). Implementations MUST support DSA-SHA1 signature algorithm (REQUIRED). RSA-SHA1 (PKCS1) is RECOMMENDED. SHA-1 as a digest algorithm is REQUIRED. HMAC-SHA1 is OPTIONAL.

security, crypto

normative-requirement §3.2.2 MUST

The canonical form of the SignatureMethod URI MUST be used during signature validation because canonicalization of SignedInfo may alter relative URIs (e.g., absolutization). However, the required Canonical XML algorithm does not change URIs.

security, crypto

normative-requirement §1.3 MUST

The XML namespace URI that MUST be used by implementations of this specification is 'http://www.w3.org/2000/09/xmldsig#'. While applications MUST support XML and XML namespaces, use of internal entities or the 'dsig' prefix and defaulting/scoping conventions are OPTIONAL.

security, crypto

normative-requirement §4.3.3.3 MUST

When processing a same-document reference, dereferencing a null URI (URI='') MUST result in an XPath node-set including every non-comment node of the XML document. Applications MUST support the null URI and barename XPointer; '#xpointer(/)' and '#xpointer(id(ID))' are RECOMMENDED if comments are to be preserved.

security, crypto

normative-requirement §4.3.1 MUST

XML-based canonicalization implementations MUST be provided with an XPath node-set originally formed from the document containing SignedInfo, indicating SignedInfo, its descendants, and the attribute and namespace nodes. Text-based canonicalization of SignedInfo is NOT RECOMMENDED.

security, crypto

normative-requirement §4.3.3.1 MUST

XML signature applications MUST be able to parse URI syntax. Dereferencing a URI in the HTTP scheme MUST comply with the HTTP Status Code Definitions (302, 305, and 307 redirects MUST be followed to obtain the entity-body of a 200 response).

security, http

protocol-element §4.4.2.1

The DSAKeyValue element encodes DSA public key parameters: P and Q (optional pair), G (optional), Y (required), J (optional efficiency parameter), and Seed/PgenCounter (optional paired generation parameters). All fields are encoded as ds:CryptoBinary (base64).

security, crypto

protocol-element §4.4 MUST

The KeyInfo element is optional and enables recipients to obtain the key needed to validate the signature. It may contain KeyName, KeyValue, RetrievalMethod, X509Data, PGPData, SPKIData, MgmtData, or extension elements. Compliant implementations MUST implement KeyValue and SHOULD implement RetrievalMethod.

security, crypto, pkix

protocol-element §5.1

The Manifest element provides an optional list of Reference elements that are not subject to mandatory core reference validation (unlike References in SignedInfo). Applications may perform selective or custom reference validation on Manifests, enabling partial-failure semantics.

security, crypto

protocol-element §4.3.3

The Reference element specifies a digest algorithm (DigestMethod), digest value (DigestValue), optional URI identifying the data object, optional Type attribute, and optional Transforms. At most one Reference per SignedInfo or Manifest may omit the URI attribute.

security, crypto

protocol-element §4.4.2.2

The RSAKeyValue element encodes an RSA public key with two fields: Modulus and Exponent, both encoded as ds:CryptoBinary (base64 big-endian octet strings).

security, crypto

protocol-element §4.1

The Signature element is the root of an XML Signature with structure: SignedInfo (required), SignatureValue (required), KeyInfo (optional), Object* (zero or more), and an optional Id attribute. The SignedInfo element is the information actually signed.

security, crypto

protocol-element §5.2

The SignatureProperties element within an Object element holds assertions about the signature itself (e.g., time of signing, hardware serial number). Each SignatureProperty MUST have a mandatory Target attribute referencing the applicable Signature element.

security, crypto

protocol-element §4.3

The SignedInfo element contains CanonicalizationMethod, SignatureMethod, and one or more Reference elements. It is the content that is canonicalized and then signed; the algorithms used in calculating the SignatureValue are included within SignedInfo.

security, crypto

protocol-element §4.4.4

The X509Data element contains identifiers for X.509 certificates: X509IssuerSerial (issuer DN/serial number pair, SHOULD be RFC 2253 compliant), X509SubjectName, X509SKI (base64 SubjectKeyIdentifier), X509Certificate (base64 DER), and X509CRL. All certificate references within one X509Data element MUST relate to the same certificate.

security, pkix, crypto

security-consideration §8.3

Applications should select appropriate algorithm identifiers, key lengths, and certificates for their security requirements. The specification defines mandatory (DSA-SHA1, SHA-1, Canonical XML) and optional algorithms, but algorithm strength and key management are application responsibilities.

security, crypto

security-consideration §8.1.2

Only what is 'seen' should be signed and verifiers must 'see' what is signed. A malicious CanonicalizationMethod inside SignedInfo could rewrite URIs, erase itself from SignedInfo, or transform SignedInfo so validation always succeeds. Applications MUST exercise great care before accepting and executing an arbitrary CanonicalizationMethod.

security, crypto

security-consideration §8.1.1

Only what is signed is secure. When transforms are applied, the signer signs the transformed (not native) document. Verifiers must understand and validate the transforms; content excluded by XPath transforms can change without invalidating the signature, which may create security gaps if the excluded content is security-relevant.

security, crypto

security-consideration §8.2

XML Signature alone does not specify how keys are associated with persons or institutions, nor the meaning of signed data. Applications must specify additional key, algorithm, processing, and rendering requirements. HMAC-based signatures provide message authentication, not signer authentication.

security, crypto

state-machine §4.3.3.2

The Reference Processing Model defines data-type transitions: if the current data object is an octet stream and the next Transform requires a node-set, the application MUST parse the octets as XML; if the data is a node-set and the next Transform requires octets, the application MUST convert using Canonical XML. The final output is an octet stream fed to DigestMethod.

security, crypto

wire-format §4.3.3.6

The DigestValue element contains the encoded digest value, always encoded using base64 [MIME], of type ds:DigestValueType (restriction of base64Binary).

security, crypto

wire-format §4.0.1

The ds:CryptoBinary simple type encodes arbitrary-length integers as base64 [MIME] octet strings: the integer is converted to big-endian bitstring, padded to a multiple of 8 bits, leading zero octets are removed, then base64-encoded. Used for RSA/DSA key parameters.

security, crypto

wire-format §4.2

The SignatureValue element contains the digital signature value always encoded using base64 [MIME]. It is defined as base64Binary (not CryptoBinary) to preserve leading zero octets, e.g., in HMAC-SHA1 output.

security, crypto