XMLSignature
,
SignedInfo
,
CanonicalizationMethod
,
SignatureMethod
,
Reference
,
DigestMethod
,
XMLObject
,
Manifest
,
SignatureProperties
, and
SignatureProperty
.
KeyInfo
types are defined in the
javax.xml.crypto.dsig.keyinfo
subpackage.
XMLSignatureFactory
is an abstract factory that creates
XMLSignature
objects from scratch
or from a pre-existing XML representation, such as a DOM node.
javax.xml.crypto.dsig.TransformService
is a service provider
interface for creating and plugging in implementations of
transform and canonicalization algorithms.
Of primary significance in this package is the
XMLSignature
class,
which allows you to sign and validate an XML digital signature.
XMLSignatureFactory
and
KeyInfoFactory
classes
and is responsible for creating objects and algorithms that parse, generate
and validate XML Signatures and KeyInfo structures. A concrete implementation
of XMLSignatureFactory
MUST provide support for each of the REQUIRED
algorithms as specified by the W3C recommendation for XML Signatures. It MAY
support other algorithms as defined by the W3C recommendation or other
specifications.
The API leverages the JCA provider model (see
the Provider class
) for registering and
loading XMLSignatureFactory
and KeyInfoFactory
implementations.
Each concrete XMLSignatureFactory
or KeyInfoFactory
implementation supports a specific XML mechanism type that identifies the XML
processing mechanism that an implementation uses internally to parse and
generate XML signature and KeyInfo structures.
A service provider implementation SHOULD use underlying JCA engine
classes, such as java.
and
java.
to perform cryptographic operations.
In addition to the XMLSignatureFactory
and KeyInfoFactory
classes, the API supports a service provider interface for transform and
canonicalization algorithms. The TransformService
class allows you to
develop and plug in an implementation of a specific transform or
canonicalization algorithm for a particular XML mechanism type. The TransformService
class uses the standard JCA provider model for registering
and loading implementations. Each service provider implementation SHOULD use
the TransformService
class to find a provider that supports transform
and canonicalization algorithms in XML Signatures that it is generating or
validating.
XMLSignatureFactory
, KeyInfoFactory
or TransformService
in order to minimize interoperability problems:
unmarshalXMLSignature
method of XMLSignatureFactory
MUST support DOMValidateContext
types. If the type is
DOMValidateContext
, it SHOULD contain an Element
of type
Signature. Additionally, the unmarshalXMLSignature
method MAY
populate the Id/Element mappings of the passed-in DOMValidateContext
.
sign
method of XMLSignature
s produced by
XMLSignatureFactory
MUST support DOMSignContext
types and the
validate
method MUST support DOMValidateContext
types. This
requirement also applies to the validate
method of SignatureValue
and the validate
method of Reference
.DOMStructure
s as the mechanism
for the application to specify extensible content (any elements or mixed
content).dereference
method of user-specified URIDereferencer
s returns NodeSetData
objects, the iterator
method MUST return an iteration over objects of type org.w3c.dom.Node
.URIReference
objects passed to the dereference
method of
user-specified URIDereferencer
s MUST be of type DOMURIReference
and XMLCryptoContext
objects MUST implement DOMCryptoContext
.URIDereferencer
s
returned by the getURIDereferencer
method of XMLSignatureFactory
and KeyInfoFactory
.unmarshalKeyInfo
method of KeyInfoFactory
MUST
support DOMStructure
types. If the type is DOMStructure
, it
SHOULD contain an Element
of type KeyInfo
.transform
method of Transform
MUST support
DOMCryptoContext
context parameter types.newtransform
and newCanonicalizationMethod
methods of
XMLSignatureFactory
MUST support DOMStructure
parameter
types.init
, and marshalParams
methods of
TransformService
MUST support DOMStructure
and
DOMCryptoContext
types.unmarshalXMLSignature
method of XMLSignatureFactory
MUST support DOMStructure
types. If the type is DOMStructure
,
it SHOULD contain an Element
of type Signature
.marshal
method of KeyInfo
MUST support
DOMStructure
and DOMCryptoContext
parameter types.Note that a DOM implementation MAY internally use other XML parsing APIs
other than DOM as long as it doesn't affect interoperability. For example, a
DOM implementation of XMLSignatureFactory
might use a SAX parser
internally to canonicalize data.
Modifier and Type | Interface and Description |
---|---|
public interface | CanonicalizationMethod
A representation of the XML |
public interface | DigestMethod
A representation of the XML |
public interface | Manifest
A representation of the XML |
public interface | Reference
A representation of the |
public interface | SignatureMethod
A representation of the XML |
public interface | SignatureProperties
A representation of the XML |
public interface | SignatureProperty
A representation of the XML |
public interface | SignedInfo
An representation of the XML |
public interface | Transform
A representation of the XML |
public interface | XMLObject
A representation of the XML |
public interface | XMLSignature
A representation of the XML |
public interface | XMLSignContext
Contains context information for generating XML Signatures. |
public interface | XMLValidateContext
Contains context information for validating XML Signatures. |
Modifier and Type | Class and Description |
---|---|
public class | TransformException
Indicates an exceptional condition that occurred while executing a transform algorithm. |
public abstract class | TransformService
A Service Provider Interface for transform and canonicalization algorithms. |
public class | XMLSignatureException
Indicates an exceptional condition that occurred during the XML signature generation or validation process. |
public abstract class | XMLSignatureFactory
A factory for creating |