|
abstract
¡¡¡¡this document specifies xml digital signature
processing rules and syntax. xml signatures provide
integrity, message authentication, and/or signer
authentication services for data of any type, whether
located within the xml that includes the signature or
elsewhere.
¡¡¡¡status of this document
¡¡¡¡this document has been reviewed by w3c members and
other interested parties and has been endorsed by the
director as a w3c recommendation. it is a stable
document and may be used as reference material or cited
as a normative reference from another document. w3c's
role in making the recommendation is to draw attention
to the specification and to promote its widespread
deployment. this enhances the functionality and
interoperability of the web.
¡¡¡¡this specification was produced by the ietf/w3c
xml signature working group (w3c activity statement)
which believes the specification is sufficient for the
creation of independent interoperable implementations;
the interoperability report shows at least 10
implementations with at least two interoperable
implementations over every feature.
¡¡¡¡patent disclosures relevant to this specification
may be found on the working group's patent disclosure
page, in conformance with w3c policy, and the ietf page
of intellectual property rights notices, in conformance
with ietf policy.
¡¡¡¡please report errors in this document to
w3c-ietf-xmldsig@w3.org (archive).
¡¡¡¡the list of known errors in this specification is
available at http://www.w3.org/2001/10/xmldsig-errata.
¡¡¡¡the english version of this specification is the
only normative version. information about translations
of this document (if any) is available
http://www.w3.org/signature/2002/02/xmldsig-translations
¡¡¡¡a list of current w3c technical reports can be
found at http://www.w3.org/tr/.
¡¡¡¡table of contents
¡¡¡¡1.introduction
1.editorial
conventions
2.design
philosophy
3.versions,
namespaces and identifiers
¡¡¡¡¡¡4.acknowledgements
¡¡¡¡2.signature overview and
examples
1.simple
example (signature, signedinfo, methods, and references)
¡ómore on reference
¡¡¡¡¡¡2.extended example
(object and signatureproperty)
3.extended example (object and manifest)
¡¡¡¡3.processing rules
1.signature generation
¡¡¡¡¡¡2.signature
validation
¡¡¡¡4.core signature syntax
¡¡¡¡¡¡1.the signature
element
¡¡¡¡¡¡2.the
signaturevalue element
¡¡¡¡¡¡3.the signedinfo
element
¡óthe canonicalizationmethod element
¡¡¡¡¡¡¡¡¡óthe signaturemethod element
¡óthe reference element
the uri attribute
¡¡¡¡¡¡¡¡¡¡¡¡the reference processing model
¡¡¡¡¡¡¡¡¡¡¡¡same-document uri-references
¡¡¡¡¡¡¡¡¡¡¡¡the transforms element
¡¡¡¡¡¡¡¡¡¡¡¡the digestmethod element
¡¡¡¡¡¡¡¡¡¡¡¡the digestvalue element
4.the keyinfo element
¡¡¡óthe keyname element
¡¡¡óthe keyvalue
element
¡¡ the
dsakeyvalue element
¡¡ the
rsakeyvalue element
¡¡¡¡¡óthe retrievalmethod element
¡¡¡¡¡óthe x509data element
¡¡¡¡¡óthe pgpdata element
¡¡¡¡¡óthe spkidata element
¡óthe
mgmtdata element
5.the object element
5.additional
signature syntax
1.the
manifest element
2.the
signatureproperties element
3.processing
instructions
4.comments
in dsig elements
6.algorithms
1.algorithm
identifiers and implementation requirements
2.message
digests
3.message
authentication codes
4.signature
algorithms
5.canonicalization
algorithms
6.transform
algorithms
¡ócanonicalization
¡óbase64
¡óxpath
filtering
¡óenveloped
signature transform
¡óxslt
transform
7.xml
canonicalization and syntax constraint considerations
1.xml
1.0, syntax constraints, and canonicalization
2.dom/sax
processing and canonicalization
3.namespace
context and portable signatures
8.security
considerations
1.transforms
¡óonly what
is signed is secure
¡óonly what
is "seen" should be signed
¡ó"see" what is signed
2.check
the security model
3.algorithms,
key lengths, etc.
9.schema, dtd,
data model, and valid examples
10.definitions
11.references
--------------------------------------------------------------------------------
¡¡¡¡1.0 introduction
this document specifies xml syntax
and processing rules for creating and representing
digital signatures. xml signatures can be applied to any
digital content (data object), including xml. an xml
signature may be applied to the content of one or more
resources. enveloped or enveloping signatures are over
data within the same xml document as the signature;
detached signatures are over data external to the
signature element. more specifically, this specification
defines an xml signature element type and an xml
signature application; conformance requirements for each
are specified by way of schema definitions and prose
respectively. this specification also includes other
useful types that identify methods for referencing
collections of resources, algorithms, and keying and
management information.
¡¡¡¡the xml signature is a method of associating a key
with referenced data (octets); it does not normatively
specify how keys are associated with persons or
institutions, nor the meaning of the data being
referenced and signed. consequently, while this
specification is an important component of secure xml
applications, it itself is not sufficient to address all
application security/trust concerns, particularly with
respect to using signed xml (or other data formats) as a
basis of human-to-human communication and agreement.
such an application must specify additional key,
algorithm, processing and rendering requirements. for
further information, please see security considerations
(section 8).
¡¡¡¡1.1 editorial and
conformance conventions
¡¡¡¡for readability, brevity, and historic reasons
this document uses the term "signature" to
generally refer to digital authentication values of all
types. obviously, the term is also strictly used to
refer to authentication values that are based on public
keys and that provide signer authentication. when
specifically discussing authentication values based on
symmetric secret key codes we use the terms
authenticators or authentication codes. (see check the
security model, section 8.3.)
¡¡¡¡this specification provides an xml schema [xml-schema]
and dtd [xml]. the schema definition is normative.
¡¡¡¡the key words "must", "must
not", "required", "shall",
"shall not", "should", "should
not", "recommended", "may", and
"optional" in this specification are to be
interpreted as described in rfc2119 [keywords]:
¡¡¡¡"they must only be used where it is actually
required for interoperation or to limit behavior which
has potential for causing harm (e.g., limiting
retransmissions)"
¡¡¡¡consequently, we use these capitalized key words
to unambiguously specify requirements over protocol and
application features and behavior that affect the
interoperability and security of implementations. these
key words are not used (capitalized) to describe xml
grammar; schema definitions unambiguously describe such
requirements and we wish to reserve the prominence of
these terms for the natural language descriptions of
protocols and features. for instance, an xml attribute
might be described as being "optional."
compliance with the namespaces in xml specification [xml-ns]
is described as "required."
¡¡¡¡1.2 design philosophy
¡¡¡¡the design philosophy and requirements of this
specification are addressed in the xml-signature
requirements document [xml-signature-rd].
¡¡¡¡1.3 versions, namespaces and
identifiers
¡¡¡¡no provision is made for an explicit version
number in this syntax. if a future version is needed, it
will use a different namespace. the xml namespace [xml-ns]
uri that must be used by implementations of this (dated)
specification is:
¡¡¡¡xmlns="http://www.w3.org/2000/09/xmldsig#"
¡¡¡¡this namespace is also used as the prefix for
algorithm identifiers used by this specification. while
applications must support xml and xml namespaces, the
use of internal entities [xml] or our "dsig"
xml namespace prefix and defaulting/scoping conventions
are optional; we use these facilities to provide compact
and readable examples.
¡¡¡¡this specification uses uniform resource
identifiers [uri] to identify resources, algorithms, and
semantics. the uri in the namespace declaration above is
also used as a prefix for uris under the control of this
specification. for resources not under the control of
this specification, we use the designated uniform
resource names [urn] or uniform resource locators [url]
defined by its normative external specification. if an
external specification has not allocated itself a
uniform resource identifier we allocate an identifier
under our own namespace. for instance:
¡¡¡¡signatureproperties is identified and defined by
this specification's namespace
¡¡¡¡http://www.w3.org/2000/09/xmldsig#signatureproperties
¡¡¡¡xslt is identified and defined by an external uri
¡¡¡¡http://www.w3.org/tr/1999/rec-xslt-19991116
¡¡¡¡sha1 is identified via this specification's
namespace and defined via a normative reference
¡¡¡¡http://www.w3.org/2000/09/xmldsig#sha1
¡¡¡¡fips pub 180-1. secure hash standard. u.s.
department of commerce/national institute of standards
and technology.
¡¡¡¡finally, in order to provide for terse namespace
declarations we sometimes use xml internal entities [xml]
within uris. for instance:
¡¡¡¡<?xml version='1.0'?>
¡¡¡¡<!doctype signature system
¡¡¡¡"xmldsig-core-schema.dtd" [ <!entity
dsig
¡¡¡¡"http://www.w3.org/2000/09/xmldsig#">
]>
¡¡¡¡<signature xmlns="&dsig;"
id="myfirstsignature">
¡¡¡¡<signedinfo>
¡¡¡¡...
¡¡¡¡1.4 acknowledgements
¡¡¡¡the contributions of the following working group
members to this specification are gratefully
acknowledged:
¡¡¡¡¡ómark bartel, accelio (author)
¡¡¡¡¡ójohn boyer, pureedge (author)
¡¡¡¡¡ómariano p. consens, university of waterloo
¡¡¡¡¡ójohn cowan, reuters health
¡¡¡¡¡ódonald eastlake 3rd, motorola (chair,
author/editor)
¡¡¡¡¡óbarb fox, microsoft (author)
¡¡¡¡¡óchristian geuer-pollmann, university siegen
¡¡¡¡¡ótom gindin, ibm
¡¡¡¡¡óphillip hallam-baker, verisign inc
¡¡¡¡¡órichard himes, us courts
¡¡¡¡¡ómerlin hughes, baltimore
¡¡¡¡¡ógregor karlinger, iaik tu graz
¡¡¡¡¡óbrian lamacchia, microsoft (author)
¡¡¡¡¡ópeter lipp, iaik tu graz
¡¡¡¡¡ójoseph reagle, w3c (chair, author/editor)
¡¡¡¡¡óed simon, xmlsec (author)
¡¡¡¡¡ódavid solo, citigroup (author/editor)
¡¡¡¡¡ópetteri stenius, capslock
¡¡¡¡¡óraghavan srinivas, sun
¡¡¡¡¡ókent tamura, ibm
¡¡¡¡¡ówinchel todd vincent iii, gsu
¡¡¡¡¡ócarl wallace, corsec security, inc.
¡¡¡¡¡ógreg whitehead, signio inc.
¡¡¡¡as are the last call comments from the following:
¡¡¡¡¡ódan connolly, w3c
¡¡¡¡¡ópaul biron, kaiser permanente, on behalf of the
xml schema wg.
¡¡¡¡¡ómartin j. duerst, w3c; and masahiro sekiguchi,
fujitsu; on behalf of the internationalization wg/ig.
¡¡¡¡¡ójonathan marsh, microsoft, on behalf of the
extensible stylesheet language wg.
¡¡¡¡2.0
signature overview and examples
¡¡¡¡this section provides an overview and examples of
xml digital signature syntax. the specific processing is
given in processing rules (section 3). the formal syntax
is found in core signature syntax (section 4) and
additional signature syntax (section 5).
¡¡¡¡in this section, an informal representation and
examples are used to describe the structure of the xml
signature syntax. this representation and examples may
omit attributes, details and potential features that are
fully explained later.
¡¡¡¡xml signatures are applied to arbitrary digital
content (data objects) via an indirection. data objects
are digested, the resulting value is placed in an
element (with other information) and that element is
then digested and cryptographically signed. xml digital
signatures are represented by the signature element
which has the following structure (where "?"
denotes zero or one occurrence; "+" denotes
one or more occurrences; and "*" denotes zero
or more occurrences):
¡¡¡¡<signature id?>
¡¡¡¡<signedinfo>
¡¡¡¡<canonicalizationmethod/>
¡¡¡¡<signaturemethod/>
¡¡¡¡(<reference uri? >
¡¡¡¡(<transforms>)?
¡¡¡¡<digestmethod>
¡¡¡¡<digestvalue>
¡¡¡¡</reference>)+
¡¡¡¡</signedinfo>
¡¡¡¡<signaturevalue>
¡¡¡¡(<keyinfo>)?
¡¡¡¡(<object id?>)*
¡¡¡¡</signature>
¡¡¡¡signatures are related to data objects via uris
[uri]. within an xml document, signatures are related to
local data objects via fragment identifiers. such local
data can be included within an enveloping signature or
can enclose an enveloped signature. detached signatures
are over external network resources or local data
objects that reside within the same xml document as
sibling elements; in this case, the signature is neither
enveloping (signature is parent) nor enveloped
(signature is child). since a signature element (and its
id attribute value/name) may co-exist or be combined
with other elements (and their ids) within a single xml
document, care should be taken in choosing names such
that there are no subsequent collisions that violate the
id uniqueness validity constraint [xml].
¡¡¡¡2.1 simple example
(signature, signedinfo, methods, and reference)s
¡¡¡¡the following example is a detached signature of
the content of the html4 in xml specification.
¡¡¡¡[s01] <signature id="myfirstsignature"
¡¡¡¡xmlns="http://www.w3.org/2000/09/xmldsig#">
¡¡¡¡[s02] <signedinfo>
¡¡¡¡[s03] <canonicalizationmethod
¡¡¡¡algorithm="http://www.w3.org/tr/2001/rec-xml-c14n-20010315"/>
¡¡¡¡[s04] <signaturemethod
¡¡¡¡algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1"/>
¡¡¡¡[s05] <reference
¡¡¡¡uri="http://www.w3.org/tr/2000/rec-xhtml1-20000126/">
¡¡¡¡[s06] <transforms>
¡¡¡¡[s07] <transform
algorithm="http://www.w3.org/tr/2001/rec-xml-c14n-20010315"/>
¡¡¡¡[s08] </transforms>
¡¡¡¡[s09] <digestmethod
algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
¡¡¡¡[s10] <digestvalue>j6lwx3rvepo0vktmup4nbevu8nk=</digestvalue>
¡¡¡¡[s11] </reference>
¡¡¡¡[s12] </signedinfo>
¡¡¡¡[s13] <signaturevalue>mc0cffrvltrlk=...</signaturevalue>
¡¡¡¡[s14] <keyinfo>
¡¡¡¡[s15a] <keyvalue>
¡¡¡¡[s15b] <dsakeyvalue>
¡¡¡¡[s15c]
<p>...</p><q>...</q><g>...</g><y>...</y>
¡¡¡¡[s15d] </dsakeyvalue>
¡¡¡¡[s15e] </keyvalue>
¡¡¡¡[s16] </keyinfo>
¡¡¡¡[s17] </signature>
¡¡¡¡[s02-12] the required signedinfo element is the
information that is actually signed. core validation of
signedinfo consists of two mandatory processes:
validation of the signature over signedinfo and
validation of each reference digest within signedinfo.
note that the algorithms used in calculating the
signaturevalue are also included in the signed
information while the signaturevalue element is outside
signedinfo.
¡¡¡¡[s03] the canonicalizationmethod is the algorithm
that is used to canonicalize the signedinfo element
before it is digested as part of the signature
operation. note that this example, and all examples in
this specification, are not in canonical form.
¡¡¡¡[s04] the signaturemethod is the algorithm that is
used to convert the canonicalized signedinfo into the
signaturevalue. it is a combination of a digest
algorithm and a key dependent algorithm and possibly
other algorithms such as padding, for example rsa-sha1.
the algorithm names are signed to resist attacks based
on substituting a weaker algorithm. to promote
application interoperability we specify a set of
signature algorithms that must be implemented, though
their use is at the discretion of the signature creator.
we specify additional algorithms as recommended or
optional for implementation; the design also permits
arbitrary user specified algorithms.
¡¡¡¡[s05-11] each reference element includes the
digest method and resulting digest value calculated over
the identified data object. it also may include
transformations that produced the input to the digest
operation. a data object is signed by computing its
digest value and a signature over that value. the
signature is later checked via reference and signature
validation.
¡¡¡¡[s14-16] keyinfo indicates the key to be used to
validate the signature. possible forms for
identification include certificates, key names, and key
agreement algorithms and information -- we define only a
few. keyinfo is optional for two reasons. first, the
signer may not wish to reveal key information to all
document processing parties. second, the information may
be known within the application's context and need not
be represented explicitly. since keyinfo is outside of
signedinfo, if the signer wishes to bind the keying
information to the signature, a reference can easily
identify and include the keyinfo as part of the
signature.
¡¡¡¡2.1.1 more on
reference
¡¡¡¡[s05] <reference uri="http://www.w3.org/tr/2000/rec-xhtml1-20000126/">
¡¡¡¡[s06] <transforms>
¡¡¡¡[s07] <transform
algorithm="http://www.w3.org/tr/2001/rec-xml-c14n-20010315"/>
¡¡¡¡[s08] </transforms>
¡¡¡¡[s09] <digestmethod
algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
¡¡¡¡[s10] <digestvalue>j6lwx3rvepo0vktmup4nbevu8nk=</digestvalue>
¡¡¡¡[s11] </reference>
¡¡¡¡[s05] the optional uri attribute of reference
identifies the data object to be signed. this attribute
may be omitted on at most one reference in a signature.
(this limitation is imposed in order to ensure that
references and objects may be matched unambiguously.)
¡¡¡¡[s05-08] this identification, along with the
transforms, is a description provided by the signer on
how they obtained the signed data object in the form it
was digested (i.e. the digested content). the verifier
may obtain the digested content in another method so
long as the digest verifies. in particular, the verifier
may obtain the content from a different location such as
a local store than that specified in the uri.
¡¡¡¡[s06-08] transforms is an optional ordered list of
processing steps that were applied to the resource's
content before it was digested. transforms can include
operations such as canonicalization, encoding/decoding
(including compression/inflation), xslt, xpath, xml
schema validation, or xinclude. xpath transforms permit
the signer to derive an xml document that omits portions
of the source document. consequently those excluded
portions can change without affecting signature
validity. for example, if the resource being signed
encloses the signature itself, such a transform must be
used to exclude the signature value from its own
computation. if no transforms element is present, the
resource's content is digested directly. while the
working group has specified mandatory (and optional)
canonicalization and decoding algorithms, user specified
transforms are permitted.
¡¡¡¡[s09-10] digestmethod is the algorithm applied to
the data after transforms is applied (if specified) to
yield the digestvalue. the signing of the digestvalue is
what binds a resources content to the signer's key.
¡¡¡¡2.2 extended example (object
and signatureproperty)
¡¡¡¡this specification does not address mechanisms for
making statements or assertions. instead, this document
defines what it means for something to be signed by an
xml signature (integrity, message authentication, and/or
signer authentication). applications that wish to
represent other semantics must rely upon other
technologies, such as [xml, rdf]. for instance, an
application might use a foo:assuredby attribute within
its own markup to reference a signature element.
consequently, it's the application that must understand
and know how to make trust decisions given the validity
of the signature and the meaning of assuredby syntax. we
also define a signatureproperties element type for the
inclusion of assertions about the signature itself
(e.g., signature semantics, the time of signing or the
serial number of hardware used in cryptographic
processes). such assertions may be signed by including a
reference for the signatureproperties in signedinfo.
while the signing application should be very careful
about what it signs (it should understand what is in the
signatureproperty) a receiving application has no
obligation to understand that semantic (though its
parent trust engine may wish to). any content about the
signature generation may be located within the
signatureproperty element. the mandatory target
attribute references the signature element to which the
property applies.
¡¡¡¡consider the preceding example with an additional
reference to a local object that includes a
signatureproperty element. (such a signature would not
only be detached [p02] but enveloping [p03].)
¡¡¡¡[ ] <signature id="mysecondsignature"
...>
¡¡¡¡[p01] <signedinfo>
¡¡¡¡[ ] ...
¡¡¡¡[p02] <reference uri="http://www.w3.org/tr/xml-stylesheet/">
¡¡¡¡[ ] ...
¡¡¡¡[p03] <reference uri="#amadeuptimestamp"
¡¡¡¡[p04] type="http://www.w3.org/2000/09/xmldsig#signatureproperties">
¡¡¡¡[p05] <digestmethod
algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
¡¡¡¡[p06] <digestvalue>k3453rvepo0vktmup4nbevu8nk=</digestvalue>
¡¡¡¡[p07] </reference>
¡¡¡¡[p08] </signedinfo>
¡¡¡¡[p09] ...
¡¡¡¡[p10] <object>
¡¡¡¡[p11] <signatureproperties>
¡¡¡¡[p12] <signatureproperty id="amadeuptimestamp"
target="#mysecondsignature">
¡¡¡¡[p13] <timestamp xmlns="http://www.ietf.org/rfcxxxx.txt">
¡¡¡¡[p14] <date>19990908</date>
¡¡¡¡[p15] <time>14:34:34:34</time>
¡¡¡¡[p16] </timestamp>
¡¡¡¡[p17] </signatureproperty>
¡¡¡¡[p18] </signatureproperties>
¡¡¡¡[p19] </object>
¡¡¡¡[p20]</signature>
¡¡¡¡[p04] the optional type attribute of reference
provides information about the resource identified by
the uri. in particular, it can indicate that it is an
object, signatureproperty, or manifest element. this can
be used by applications to initiate special processing
of some reference elements. references to an xml data
element within an object element should identify the
actual element pointed to. where the element content is
not xml (perhaps it is binary or encoded data) the
reference should identify the object and the reference
type, if given, should indicate object. note that type
is advisory and no action based on it or checking of its
correctness is required by core behavior.
¡¡¡¡[p10] object is an optional element for including
data objects within the signature element or elsewhere.
the object can be optionally typed and/or encoded.
¡¡¡¡[p11-18] signature properties, such as time of
signing, can be optionally signed by identifying them
from within a reference. (these properties are
traditionally called signature "attributes"
although that term has no relationship to the xml term
"attribute".)
¡¡¡¡2.3 extended example (object
and manifest)
¡¡¡¡the manifest element is provided to meet
additional requirements not directly addressed by the
mandatory parts of this specification. two requirements
and the way the manifest satisfies them follow.
¡¡¡¡first, applications frequently need to efficiently
sign multiple data objects even where the signature
operation itself is an expensive public key signature.
this requirement can be met by including multiple
reference elements within signedinfo since the inclusion
of each digest secures the data digested. however, some
applications may not want the core validation behavior
associated with this approach because it requires every
reference within signedinfo to undergo reference
validation -- the digestvalue elements are checked.
these applications may wish to reserve reference
validation decision logic to themselves. for example, an
application might receive a signature valid signedinfo
element that includes three reference elements. if a
single reference fails (the identified data object when
digested does not yield the specified digestvalue) the
signature would fail core validation. however, the
application may wish to treat the signature over the two
valid reference elements as valid or take different
actions depending on which fails. to accomplish this,
signedinfo would reference a manifest element that
contains one or more reference elements (with the same
structure as those in signedinfo). then, reference
validation of the manifest is under application control.
¡¡¡¡second, consider an application where many
signatures (using different keys) are applied to a large
number of documents. an inefficient solution is to have
a separate signature (per key) repeatedly applied to a
large signedinfo element (with many references); this is
wasteful and redundant. a more efficient solution is to
include many references in a single manifest that is
then referenced from multiple signature elements.
¡¡¡¡the example below includes a reference that signs
a manifest found within the object element.
¡¡¡¡[ ] ...
¡¡¡¡[m01] <reference uri="#myfirstmanifest"
¡¡¡¡[m02] type="http://www.w3.org/2000/09/xmldsig#manifest">
¡¡¡¡[m03] <digestmethod
algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
¡¡¡¡[m04] <digestvalue>345x3rvepo0vktmup4nbevu8nk=</digestvalue>
¡¡¡¡[m05] </reference>
¡¡¡¡[ ] ...
¡¡¡¡[m06] <object>
¡¡¡¡[m07] <manifest id="myfirstmanifest">
¡¡¡¡[m08] <reference>
¡¡¡¡[m09] ...
¡¡¡¡[m10] </reference>
¡¡¡¡[m11] <reference>
¡¡¡¡[m12] ...
¡¡¡¡[m13] </reference>
¡¡¡¡[m14] </manifest>
¡¡¡¡[m15] </object>
¡¡¡¡3.0 processing rules
¡¡¡¡the sections below describe the operations to be
performed as part of signature generation and
validation.
¡¡¡¡3.1 core generation
¡¡¡¡the required steps include the generation of
reference elements and the signaturevalue over
signedinfo.
¡¡¡¡3.1.1 reference
generation
¡¡¡¡for each data object being signed:
¡¡¡¡apply the transforms, as determined by the
application, to the data object.
¡¡¡¡calculate the digest value over the resulting data
object.
¡¡¡¡create a reference element, including the
(optional) identification of the data object, any
(optional) transform elements, the digest algorithm and
the digestvalue. (note, it is the canonical form of
these references that are signed in 3.1.2 and validated
in 3.2.1 .)
¡¡¡¡3.1.2 signature
generation
¡¡¡¡create signedinfo element with signaturemethod,
canonicalizationmethod and reference(s).
¡¡¡¡canonicalize and then calculate the signaturevalue
over signedinfo based on algorithms specified in
signedinfo.
¡¡¡¡construct the signature element that includes
signedinfo, object(s) (if desired, encoding may be
different than that used for signing), keyinfo (if
required), and signaturevalue.
¡¡¡¡note, if the signature includes same-document
references, [xml] or [xml-schema] validation of the
document might ¡¡¡¡introduce changes that break the
signature. consequently, applications should be careful
to consistently process the document or refrain from
using external contributions (e.g., defaults and
entities).
¡¡¡¡3.2 core validation
¡¡¡¡the required steps of core validation include (1)
reference validation, the verification of the digest
contained in each reference in signedinfo, and (2) the
cryptographic signature validation of the signature
calculated over signedinfo.
¡¡¡¡note, there may be valid signatures that some
signature applications are unable to validate. reasons
for this include failure to implement optional parts of
this specification, inability or unwillingness to
execute specified algorithms, or inability or
unwillingness to dereference specified uris (some uri
schemes may cause undesirable side effects), etc.
¡¡¡¡comparison of values in reference and signature
validation are over the numeric (e.g., integer) or
decoded octet sequence of the value. different
implementations may produce different encoded digest and
signature values when processing the same resources
because of variances in their encoding, such as
accidental white space. but if one uses numeric or octet
comparison (choose one) on both the stated and computed
values these problems are eliminated.
¡¡¡¡3.2.1 reference
validation
¡¡¡¡canonicalize the signedinfo element based on the
canonicalizationmethod in signedinfo.
¡¡¡¡for each reference in signedinfo:
¡¡¡¡obtain the data object to be digested. (for
example, the signature application may dereference the
uri and execute transforms provided by the signer in the
reference element, or it may obtain the content through
other means such as a local cache.)
¡¡¡¡digest the resulting data object using the
digestmethod specified in its reference specification.
¡¡¡¡compare the generated digest value against
digestvalue in the signedinfo reference; if there is any
mismatch, validation fails.
¡¡¡¡note, signedinfo is canonicalized in step 1. the
application must ensure that the canonicalizationmethod
has no dangerous side affects, such as rewriting uris,
(see canonicalizationmethod (section 4.3)) and that it
sees what is signed, which is the canonical form.
¡¡¡¡3.2.2 signature
validation
¡¡¡¡obtain the keying information from keyinfo or from
an external source.
¡¡¡¡obtain the canonical form of the signaturemethod
using the canonicalizationmethod and use the result (and
previously obtained keyinfo) to confirm the
signaturevalue over the signedinfo element.
¡¡¡¡note, keyinfo (or some transformed version
thereof) may be signed via a reference element.
transformation and validation of this reference (3.2.1)
is orthogonal to signature validation which uses the
keyinfo as parsed.
¡¡¡¡additionally, the signaturemethod uri may have
been altered by the canonicalization of signedinfo
(e.g., absolutization of relative uris) and it is the
canonical form that must be used. however, the required
canonicalization [xml-c14n] of this specification does
not change uris.
¡¡¡¡4.0 core signature syntax
¡¡¡¡the general structure of an xml signature
is described in signature overview (section 2). this
section provides detailed syntax of the core signature
features. features described in this section are
mandatory to implement unless otherwise indicated. the
syntax is defined via dtds and [xml-schema] with the
following xml preamble, declaration, and internal
entity.
schema
definition:
<?xml version="1.0"
encoding="utf-8"?>
<!doctype schema
public "-//w3c//dtd xmlschema
200102//en" "http://www.w3.org/2001/xmlschema.dtd"
[
<!attlist schema
xmlns:ds cdata #fixed
"http://www.w3.org/2000/09/xmldsig#">
<!entity dsig 'http://www.w3.org/2000/09/xmldsig#'>
<!entity % p ''>
<!entity % s ''>
]>
<schema xmlns="http://www.w3.org/2001/xmlschema"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
targetnamespace="http://www.w3.org/2000/09/xmldsig#"
version="0.1" elementformdefault="qualified">
|
dtd:
<!--
the following entity declarations enable
external/flexible content in
the signature content model.
#pcdata emulates schema:string; when combined with
element types it
emulates schema mixed="true".
%foo.any permits the user to include their own
element types from
other namespaces, for example:
<!entity % keyvalue.any '| ecds:ecdsakeyvalue'>
...
<!element ecds:ecdsakeyvalue (#pcdata) >
-->
<!entity % object.any ''>
<!entity % method.any ''>
<!entity % transform.any ''>
<!entity % signatureproperty.any ''>
<!entity % keyinfo.any ''>
<!entity % keyvalue.any ''>
<!entity % pgpdata.any ''>
<!entity % x509data.any ''>
<!entity % spkidata.any ''> |
¡¡¡¡4.0.1 the
ds:cryptobinary simple type
¡¡¡¡this specification defines the ds:cryptobinary
simple type for representing arbitrary-length integers
(e.g. "bignums") in xml as octet strings. the
integer value is first converted to a "big endian"
bitstring. the bitstring is then padded with leading
zero bits so that the total number of bits == 0 mod 8
(so that there are an integral number of octets). if the
bitstring contains entire leading octets that are zero,
these are removed (so the high-order octet is always
non-zero). this octet string is then base64 [mime]
encoded. (the conversion from integer to octet string is
equivalent to ieee 1363's i2osp [1363] with minimal
length).
¡¡¡¡this type is used by "bignum" values
such as rsakeyvalue and dsakeyvalue. if a value can be
of type base64binary or ds:cryptobinary they are defined
as base64binary. for example, if the signature algorithm
is rsa or dsa then signaturevalue represents a bignum
and could be ds:cryptobinary. however, if hmac-sha1 is
the signature algorithm then signaturevalue could have
leading zero octets that must be preserved. thus
signaturevalue is generically defined as of type
base64binary.
schema
definition:
<simpletype name="cryptobinary">
<restriction base="base64binary">
</restriction>
</simpletype> |
¡¡¡¡4.1 the signature element
¡¡¡¡the signature element is the root element of an
xml signature. implementation must generate laxly schema
valid [xml-schema] signature elements as specified by
the following schema:
schema
definition:
<element name="signature" type="ds:signaturetype"/>
<complextype name="signaturetype">
<sequence>
<element ref="ds:signedinfo"/>
<element ref="ds:signaturevalue"/>
<element ref="ds:keyinfo" minoccurs="0"/>
<element ref="ds:object" minoccurs="0"
maxoccurs="unbounded"/>
</sequence>
<attribute name="id"
type="id" use="optional"/>
</complextype>
|
dtd:
<!element signature (signedinfo, signaturevalue,
keyinfo?, object*) >
<!attlist signature
xmlns cdata #fixed 'http://www.w3.org/2000/09/xmldsig#'
id id #implied >
|
¡¡¡¡4.2 the signaturevalue
element
¡¡¡¡the signaturevalue element contains the actual
value of the digital signature; it is always encoded
using base64 [mime]. while we identify two
signaturemethod algorithms, one mandatory and one
optional to implement, user specified algorithms may be
used as well.
schema
definition:
<element name="signaturevalue"
type="ds:signaturevaluetype"/>
<complextype name="signaturevaluetype">
<simplecontent>
<extension base="base64binary">
<attribute name="id"
type="id" use="optional"/>
</extension>
</simplecontent>
</complextype>
|
dtd:
<!element signaturevalue (#pcdata) >
<!attlist signaturevalue
id id #implied> |
¡¡¡¡4.3 the signedinfo element
¡¡¡¡the structure of signedinfo includes the
canonicalization algorithm, a signature algorithm, and
one or more references. the signedinfo element may
contain an optional id attribute that will allow it to
be referenced by other signatures and objects.
¡¡¡¡signedinfo does not include explicit signature or
digest properties (such as calculation time,
cryptographic device serial number, etc.). if an
application needs to associate properties with the
signature or digest, it may include such information in
a signatureproperties element within an object element.
schema
definition:
<element name="signedinfo"
type="ds:signedinfotype"/>
<complextype name="signedinfotype">
<sequence>
<element ref="ds:canonicalizationmethod"/>
<element ref="ds:signaturemethod"/>
<element ref="ds:reference" maxoccurs="unbounded"/>
</sequence>
<attribute name="id"
type="id" use="optional"/>
</complextype>
|
dtd:
<!element signedinfo (canonicalizationmethod,
signaturemethod, reference+) >
<!attlist signedinfo
id id #implied |
¡¡¡¡4.3.1
the canonicalizationmethod element
¡¡¡¡canonicalizationmethod is a required element that
specifies the canonicalization algorithm applied to the
signedinfo element prior to performing signature
calculations. this element uses the general structure
for algorithms described in algorithm identifiers and
implementation requirements (section 6.1).
implementations must support the required
canonicalization algorithms.
¡¡¡¡alternatives to the required canonicalization
algorithms (section 6.5), such as canonical xml with
comments (section 6.5.1) or a minimal canonicalization
(such as crlf and charset normalization), may be
explicitly specified but are not required. consequently,
their use may not interoperate with other applications
that do not support the specified algorithm (see xml
canonicalization and syntax constraint considerations,
section 7). security issues may also arise in the
treatment of entity processing and comments if non-xml
aware canonicalization algorithms are not properly
constrained (see section 8.2: only what is
"seen" should be signed).
¡¡¡¡the way in which the signedinfo element is
presented to the canonicalization method is dependent on
that method. the following applies to algorithms which
process xml as nodes or characters:
¡¡¡¡¡óxml based canonicalization implementations must
be provided with a [xpath] node-set originally formed
from the document containing the signedinfo and
currently indicating the signedinfo, its descendants,
and the attribute and namespace nodes of signedinfo and
its descendant elements.
¡¡¡¡¡ótext based canonicalization algorithms (such as
crlf and charset normalization) should be provided with
the utf-8 octets that represent the well-formed
signedinfo element, from the first character to the last
character of the xml representation, inclusive. this
includes the entire text of the start and end tags of
the signedinfo element as well as all descendant markup
and character data (i.e., the text) between those tags.
use of text based canonicalization of signedinfo is not
recommended.
¡¡¡¡we recommend applications that implement a
text-based instead of xml-based canonicalization -- such
as resource constrained apps -- generate canonicalized
xml as their output serialization so as to mitigate
interoperability and security concerns. for instance,
such an implementation should (at least) generate
standalone xml instances [xml].
¡¡¡¡note: the signature application must exercise
great care in accepting and executing an arbitrary
canonicalizationmethod. for example, the
canonicalization method could rewrite the uris of the
references being validated. or, the method could
massively transform signedinfo so that validation would
always succeed (i.e., converting it to a trivial
signature with a known key over trivial data). since
canonicalizationmethod is inside signedinfo, in the
resulting canonical form it could erase itself from
signedinfo or modify the signedinfo element so that it
appears that a different canonicalization function was
used! thus a signature which appears to authenticate the
desired data with the desired key, digestmethod, and
signaturemethod, can be meaningless if a capricious
canonicalizationmethod is used.
schema
definition:
<element name="canonicalizationmethod"
type="ds:canonicalizationmethodtype"/>
<complextype name="canonicalizationmethodtype"
mixed="true">
<sequence>
<any namespace="##any" minoccurs="0"
maxoccurs="unbounded"/>
<!-- (0,unbounded) elements from (1,1)
namespace -->
</sequence>
<attribute name="algorithm"
type="anyuri"
use="required"/>
</complextype> |
dtd:
<!element canonicalizationmethod (#pcdata %method.any;)*
>
<!attlist canonicalizationmethod
algorithm cdata #required >
|
¡¡¡¡4.3.2 the
signaturemethod element
¡¡¡¡signaturemethod is a required element that
specifies the algorithm used for signature generation
and validation. this algorithm identifies all
cryptographic functions involved in the signature
operation (e.g. hashing, public key algorithms, macs,
padding, etc.). this element uses the general structure
here for algorithms described in section 6.1: algorithm
identifiers and implementation requirements. while there
is a single identifier, that identifier may specify a
format containing multiple distinct signature values.
schema
definition:
<element name="signaturemethod"
type="ds:signaturemethodtype"/>
<complextype name="signaturemethodtype"
mixed="true">
<sequence>
<element name="hmacoutputlength"
minoccurs="0" type="ds:hmacoutputlengthtype"/>
<any namespace="##other" minoccurs="0"
maxoccurs="unbounded"/>
<!-- (0,unbounded) elements from (1,1) external
namespace -->
</sequence>
<attribute name="algorithm"
type="anyuri"
use="required"/>
</complextype>
|
dtd:
<!element signaturemethod (#pcdata|hmacoutputlength
%method.any;)* >
<!attlist signaturemethod
algorithm cdata #required >
|
¡¡¡¡4.3.3 the reference
element
¡¡¡¡reference is an element that may occur one or more
times. it specifies a digest algorithm and digest value,
and optionally an identifier of the object being signed,
the type of the object, and/or a list of transforms to
be applied prior to digesting. the identification (uri)
and transforms describe how the digested content (i.e.,
the input to the digest method) was created. the type
attribute facilitates the processing of referenced data.
for example, while this specification makes no
requirements over external data, an application may wish
to signal that the referent is a manifest. an optional
id attribute permits a reference to be referenced from
elsewhere.
schema
definition:
<element name="reference" type="ds:referencetype"/>
<complextype name="referencetype">
<sequence>
<element ref="ds:transforms"
minoccurs="0"/>
<element ref="ds:digestmethod"/>
<element ref="ds:digestvalue"/>
</sequence>
<attribute name="id"
type="id" use="optional"/>
<attribute name="uri" type="anyuri"
use="optional"/>
<attribute name="type" type="anyuri"
use="optional"/>
</complextype> |
dtd:
<!element reference (transforms?, digestmethod,
digestvalue) >
<!attlist reference
id id #implied
uri cdata #implied
type cdata #implied> |
¡¡¡¡4.3.3.1
the uri attribute
¡¡¡¡the uri attribute identifies a data object using a
uri-reference, as specified by rfc2396 [uri]. the set of
allowed characters for uri attributes is the same as for
xml, namely [unicode]. however, some unicode characters
are disallowed from uri references including all
non-ascii characters and the excluded characters listed
in rfc2396 [uri, section 2.4]. however, the number sign
(#), percent sign (%), and square bracket characters
re-allowed in rfc 2732 [uri-literal] are permitted.
disallowed characters must be escaped as follows:
¡¡¡¡1.each disallowed character is converted to
[utf-8] as one or more octets.
¡¡¡¡2.any octets corresponding to a disallowed
character are escaped with the uri escaping mechanism
(that is, converted to %hh, where hh is the hexadecimal
notation of the octet value).
3.the original character is replaced
by the resulting character sequence.
xml signature applications must be
able to parse uri syntax. we recommend they be able to
dereference uris in the http scheme. dereferencing a uri
in the http scheme must comply with the status code
definitions of [http] (e.g., 302, 305 and 307 redirects
are followed to obtain the entity-body of a 200 status
code response). applications should also be cognizant of
the fact that protocol parameter and state information,
(such as http cookies, html device profiles or content
negotiation), may affect the content yielded by
dereferencing a uri.
if a resource is identified by more
than one uri, the most specific should be used (e.g.
http://www.w3.org/2000/06/interop-pressrelease.html.en
instead of http://www.w3.org/2000/06/interop-pressrelease).
(see the reference validation (section 3.2.1) for a
further information on reference processing.)
if the uri attribute is omitted
altogether, the receiving application is expected to
know the identity of the object. for example, a
lightweight data protocol might omit this attribute
given the identity of the object is part of the
application context. this attribute may be omitted from
at most one reference in any particular signedinfo, or
manifest.
the optional type attribute contains
information about the type of object being signed. this
is represented as a uri. for example:
¡¡¡¡type="http://www.w3.org/2000/09/xmldsig#object"
¡¡¡¡type="http://www.w3.org/2000/09/xmldsig#manifest"
¡¡¡¡the type attribute applies to the item being
pointed at, not its contents. for example, a reference
that identifies an object element containing a
signatureproperties element is still of type #object.
the type attribute is advisory. no validation of the
type information is required by this specification.
¡¡¡¡4.3.3.2 the reference
processing model
| note: xpath is
recommended. signature applications need not
conform to [xpath] specification in order to
conform to this specification. however, the xpath
data model, definitions (e.g., node-sets) and
syntax is used within this document in order to
describe functionality for those that want to
process xml-as-xml (instead of octets) as part of
signature generation. for those that want to use
these features, a conformant [xpath]
implementation is one way to implement these
features, but it is not required. such
applications could use a sufficiently functional
replacement to a node-set and implement only those
xpath expression behaviors required by this
specification. however, for simplicity we
generally will use xpath terminology without
including this qualification on every point.
requirements over "xpath node-sets" can
include a node-set functional equivalent.
requirements over xpath processing can include
application behaviors that are equivalent to the
corresponding xpath behavior. |
¡¡¡¡the
data-type of the result of uri dereferencing or
subsequent transforms is either an octet stream or an
xpath node-set.
¡¡¡¡the transforms specified in this document are
defined with respect to the input they require. the
following is the default signature application behavior:
¡¡¡¡¡óif the data object is an octet stream and the
next transform requires a node-set, the signature
application must attempt to parse the octets yielding
the required node-set via [xml] well-formed processing.
¡¡¡¡¡óif the data object is a node-set and the next
transform requires octets, the signature application
must attempt to convert the node-set to an octet stream
using canonical xml [xml-c14n].
¡¡¡¡users may specify alternative transforms that
override these defaults in transitions between
transforms that expect different inputs. the final octet
stream contains the data octets being secured. the
digest algorithm specified by digestmethod is then
applied to these data octets, resulting in the
digestvalue.
¡¡¡¡unless the uri-reference is a 'same-document'
reference as defined in [uri, section 4.2], the result
of dereferencing the uri-reference must be an octet
stream. in particular, an xml document identified by uri
is not parsed by the signature application unless the
uri is a same-document reference or unless a transform
that requires xml parsing is applied. (see transforms
(section 4.3.3.1).)
¡¡¡¡when a fragment is preceded by an absolute or
relative uri in the uri-reference, the meaning of the
fragment is defined by the resource's mime type. even
for xml documents, uri dereferencing (including the
fragment processing) might be done for the signature
application by a proxy. therefore, reference validation
might fail if fragment processing is not performed in a
standard way (as defined in the following section for
same-document references). consequently, we recommend
that the uri attribute not include fragment identifiers
and that such processing be specified as an additional
xpath transform.
¡¡¡¡when a fragment is not preceded by a uri in the
uri-reference, xml signature applications must support
the null uri and barename xpointer. we recommend support
for the same-document xpointers '#xpointer(/)' and '#xpointer(id('id'))'
if the application also intends to support any
canonicalization that preserves comments. (otherwise
uri="#foo" will automatically remove comments
before the canonicalization can even be invoked.) all
other support for xpointers is optional, especially all
support for barename and other xpointers in external
resources since the application may not have control
over how the fragment is generated (leading to
interoperability problems and validation failures).
¡¡¡¡the following examples demonstrate what the uri
attribute identifies and how it is dereferenced:
¡¡¡¡uri="http://example.com/bar.xml"
¡¡¡¡identifies the octets that represent the external
resource 'http://example.com/bar.xml', that is probably
an xml document given its file extension.
¡¡¡¡uri="http://example.com/bar.xml#chapter1"
¡¡¡¡identifies the element with id attribute value
'chapter1' of the external xml resource 'http://example.com/bar.xml',
provided as an octet stream. again, for the sake of
interoperability, the element identified as 'chapter1'
should be obtained using an xpath transform rather than
a uri fragment (barename xpointer resolution in external
resources is not required in this specification).
uri=""
¡¡¡¡identifies the node-set (minus any comment nodes)
of the xml resource containing the signature
uri="#chapter1"
¡¡¡¡identifies a node-set containing the element with
id attribute value 'chapter1' of the xml resource
containing the signature. xml signature (and its
applications) modify this node-set to include the
element plus all descendents including namespaces and
attributes -- but not comments.
¡¡¡¡4.3.3.3 same-document
uri-references
¡¡¡¡dereferencing a same-document reference must
result in an xpath node-set suitable for use by
canonical xml [xml-c14n]. specifically, dereferencing a
null uri (uri="") must result in an xpath
node-set that includes every non-comment node of the xml
document containing the uri attribute. in a fragment
uri, the characters after the number sign ('#')
character conform to the xpointer syntax [xptr]. when
processing an xpointer, the application must behave as
if the root node of the xml document containing the uri
attribute were used to initialize the xpointer
evaluation context. the application must behave as if
the result of xpointer processing were a node-set
derived from the resultant location-set as follows:
¡¡¡¡1.discard point nodes
¡¡¡¡2.replace each range node with all xpath nodes
having full or partial content within the range
3.replace the root node with its
children (if it is in the node-set)
¡¡¡¡4.replace any element node e with e plus all
descendants of e (text, comment, pi, element) and all
namespace and attribute nodes of e and its descendant
elements.
¡¡¡¡5.if the uri is not a full xpointer, then delete
all comment nodes
the second to last replacement is
necessary because xpointer typically indicates a subtree
of an xml document's parse tree using just the element
node at the root of the subtree, whereas canonical xml
treats a node-set as a set of nodes in which absence of
descendant nodes results in absence of their
representative text from the canonical form.
¡¡¡¡the last step is performed for null uris, barename
xpointers and child sequence xpointers. it's necessary
because when [xml-c14n] is passed a node-set, it
processes the node-set as is: with or without comments.
only when it's called with an octet stream does it
invoke its own xpath expressions (default or without
comments). therefore to retain the default behavior of
stripping comments when passed a node-set, they are
removed in the last step if the uri is not a full
xpointer. to retain comments while selecting an element
by an identifier id, use the following full xpointer:
uri='#xpointer(id('id'))'. to retain comments while
selecting the entire document, use the following full
xpointer: uri='#xpointer(/)'. this xpointer contains a
simple xpath expression that includes the root node,
which the second to last step above replaces with all
nodes of the parse tree (all descendants, plus all
attributes, plus all namespaces nodes).
4.3.3.4
the transforms element
the optional transforms element
contains an ordered list of transform elements; these
describe how the signer obtained the data object that
was digested. the output of each transform serves as
input to the next transform. the input to the first
transform is the result of dereferencing the uri
attribute of the reference element. the output from the
last transform is the input for the digestmethod
algorithm. when transforms are applied the signer is not
signing the native (original) document but the resulting
(transformed) document. (see only what is signed is
secure (section 8.1).)
¡¡¡¡each transform consists of an algorithm attribute
and content parameters, if any, appropriate for the
given algorithm. the algorithm attribute value specifies
the name of the algorithm to be performed, and the
transform content provides additional data to govern the
algorithm's processing of the transform input. (see
algorithm identifiers and implementation requirements
(section 6).)
¡¡¡¡as described in the reference processing model
(section 4.3.3.2), some transforms take an xpath
node-set as input, while others require an octet stream.
if the actual input matches the input needs of the
transform, then the transform operates on the unaltered
input. if the transform input requirement differs from
the format of the actual input, then the input must be
converted.
¡¡¡¡some transforms may require explicit mime type,
charset (iana registered "character set"), or
other such information concerning the data they are
receiving from an earlier transform or the source data,
although no transform algorithm specified in this
document needs such explicit information. such data
characteristics are provided as parameters to the
transform algorithm and should be described in the
specification for the algorithm.
¡¡¡¡examples of transforms include but are not limited
to base64 decoding [mime], canonicalization [xml-c14n],
xpath filtering [xpath], and xslt [xslt]. the generic
definition of the transform element also allows
application-specific transform algorithms. for example,
the transform could be a decompression routine given by
a java class appearing as a base64 encoded parameter to
a java transform algorithm. however, applications should
refrain from using application-specific transforms if
they wish their signatures to be verifiable outside of
their application domain. transform algorithms (section
6.6) defines the list of standard transformations.
schema
definition:
<element name="transforms"
type="ds:transformstype"/>
<complextype name="transformstype">
<sequence>
<element ref="ds:transform" maxoccurs="unbounded"/>
</sequence>
</complextype>
<element name="transform" type="ds:transformtype"/>
<complextype name="transformtype"
mixed="true">
<choice minoccurs="0" maxoccurs="unbounded">
<any namespace="##other"
processcontents="lax"/>
<!-- (1,1) elements from (0,unbounded)
namespaces -->
<element name="xpath"
type="string"/>
</choice>
<attribute name="algorithm"
type="anyuri"
use="required"/>
</complextype> |
dtd:
<!element transforms (transform+)>
<!element transform (#pcdata|xpath %transform.any;)*
>
<!attlist transform
algorithm cdata #required >
<!element xpath (#pcdata) >
|
¡¡¡¡4.3.3.5
the digestmethod element
¡¡¡¡digestmethod is a required element that identifies
the digest algorithm to be applied to the signed object.
this element uses the general structure here for
algorithms specified in algorithm identifiers and
implementation requirements (section 6.1).
¡¡¡¡if the result of the uri dereference and
application of transforms is an xpath node-set (or
sufficiently functional replacement implemented by the
application) then it must be converted as described in
the reference processing model (section 4.3.3.2). if the
result of uri dereference and application of transforms
is an octet stream, then no conversion occurs (comments
might be present if the canonical xml with comments was
specified in the transforms). the digest algorithm is
applied to the data octets of the resulting octet
stream.
schema
definition:
<element name="digestmethod"
type="ds:digestmethodtype"/>
<complextype name="digestmethodtype"
mixed="true">
<sequence>
<any namespace="##other"
processcontents="lax" minoccurs="0"
maxoccurs="unbounded"/>
</sequence>
<attribute name="algorithm"
type="anyuri"
use="required"/>
</complextype> |
dtd:
<!element digestmethod (#pcdata %method.any;)*
>
<!attlist digestmethod
algorithm cdata #required > |
¡¡¡¡4.3.3.6
the digestvalue element
¡¡¡¡digestvalue is an element that contains the
encoded value of the digest. the digest is always
encoded using base64 [mime].
schema
definition:
<element name="digestvalue"
type="ds:digestvaluetype"/>
<simpletype name="digestvaluetype">
<restriction base="base64binary"/>
</simpletype> |
dtd:
<!element digestvalue (#pcdata) >
<!-- base64 encoded digest value --> |
¡¡¡¡
¡¡¡¡4.4
the keyinfo element
¡¡¡¡keyinfo is an optional element that enables the
recipient(s) to obtain the key needed to validate the
signature. keyinfo may contain keys, names, certificates
and other public key management information, such as
in-band key distribution or key agreement data. this
specification defines a few simple types but
applications may extend those types or all together
replace them with their own key identification and
exchange semantics using the xml namespace facility. [xml-ns]
however, questions of trust of such key information
(e.g., its authenticity or strength) are out of scope of
this specification and left to the application.
¡¡¡¡if keyinfo is omitted, the recipient is expected
to be able to identify the key based on application
context. multiple declarations within keyinfo refer to
the same key. while applications may define and use any
mechanism they choose through inclusion of elements from
a different namespace, compliant versions must implement
keyvalue (section 4.4.2) and should implement
retrievalmethod (section 4.4.3).
¡¡¡¡the schema/dtd specifications of many of keyinfo's
children (e.g., pgpdata, spkidata, x509data) permit
their content to be extended/complemented with elements
from another namespace. this may be done only if it is
safe to ignore these extension elements while claiming
support for the types defined in this specification.
otherwise, external elements, including alternative
structures to those defined by this specification, must
be a child of keyinfo. for example, should a complete
xml-pgp standard be defined, its root element must be a
child of keyinfo. (of course, new structures from
external namespaces can incorporate elements from the
&dsig; namespace via features of the type definition
language. for instance, they can create a dtd that mixes
their own and dsig qualified elements, or a schema that
permits, includes, imports, or derives new types based
on &dsig; elements.)
¡¡¡¡the following list summarizes the keyinfo types
that are allocated an identifier in the &dsig;
namespace; these can be used within the retrievalmethod
type attribute to describe a remote keyinfo
structure.
¡¡¡¡http://www.w3.org/2000/09/xmldsig#dsakeyvalue
¡¡¡¡http://www.w3.org/2000/09/xmldsig#rsakeyvalue
¡¡¡¡http://www.w3.org/2000/09/xmldsig#x509data
¡¡¡¡http://www.w3.org/2000/09/xmldsig#pgpdata
¡¡¡¡http://www.w3.org/2000/09/xmldsig#spkidata
¡¡¡¡http://www.w3.org/2000/09/xmldsig#mgmtdata
¡¡¡¡in addition to the types above for which we define
an xml structure, we specify one additional type to
indicate a binary (asn.1 der) x.509 certificate.
¡¡¡¡http://www.w3.org/2000/09/xmldsig#rawx509certificate
schema
definition:
<element name="keyinfo" type="ds:keyinfotype"/>
<complextype name="keyinfotype"
mixed="true">
<choice maxoccurs="unbounded">
<element ref="ds:keyname"/>
<element ref="ds:keyvalue"/>
<element ref="ds:retrieval | |