public final class DOMXMLSignatureFactory extends XMLSignatureFactory
| Constructor and Description |
|---|
DOMXMLSignatureFactory()
Initializes a new instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
URIDereferencer |
getURIDereferencer()
Returns a reference to the
URIDereferencer that is used by
default to dereference URIs in Reference objects. |
boolean |
isFeatureSupported(String feature)
Indicates whether a specified feature is supported.
|
CanonicalizationMethod |
newCanonicalizationMethod(String algorithm,
C14NMethodParameterSpec params)
Creates a
CanonicalizationMethod for the specified
algorithm URI and parameters. |
CanonicalizationMethod |
newCanonicalizationMethod(String algorithm,
XMLStructure params)
Creates a
CanonicalizationMethod for the specified
algorithm URI and parameters. |
DigestMethod |
newDigestMethod(String algorithm,
DigestMethodParameterSpec params)
Creates a
DigestMethod for the specified algorithm URI
and parameters. |
Manifest |
newManifest(List references)
Creates a
Manifest containing the specified
list of References. |
Manifest |
newManifest(List references,
String id)
Creates a
Manifest containing the specified
list of References and optional id. |
Reference |
newReference(String uri,
DigestMethod dm)
Creates a
Reference with the specified URI and digest
method. |
Reference |
newReference(String uri,
DigestMethod dm,
List appliedTransforms,
Data result,
List transforms,
String type,
String id)
Creates a
Reference with the specified parameters. |
Reference |
newReference(String uri,
DigestMethod dm,
List transforms,
String type,
String id)
Creates a
Reference with the specified parameters. |
Reference |
newReference(String uri,
DigestMethod dm,
List transforms,
String type,
String id,
byte[] digestValue)
Creates a
Reference with the specified parameters and
pre-calculated digest value. |
SignatureMethod |
newSignatureMethod(String algorithm,
SignatureMethodParameterSpec params)
Creates a
SignatureMethod for the specified algorithm URI
and parameters. |
SignatureProperties |
newSignatureProperties(List props,
String id)
Creates a
SignatureProperties containing the specified
list of SignaturePropertys and optional id. |
SignatureProperty |
newSignatureProperty(List info,
String target,
String id)
Creates a
SignatureProperty containing the specified
list of XMLStructures, target URI and optional id. |
SignedInfo |
newSignedInfo(CanonicalizationMethod cm,
SignatureMethod sm,
List references)
Creates a
SignedInfo with the specified canonicalization
and signature methods, and list of one or more references. |
SignedInfo |
newSignedInfo(CanonicalizationMethod cm,
SignatureMethod sm,
List references,
String id)
Creates a
SignedInfo with the specified parameters. |
Transform |
newTransform(String algorithm,
TransformParameterSpec params)
Creates a
Transform for the specified algorithm URI
and parameters. |
Transform |
newTransform(String algorithm,
XMLStructure params)
Creates a
Transform for the specified algorithm URI
and parameters. |
XMLObject |
newXMLObject(List content,
String id,
String mimeType,
String encoding)
Creates an
XMLObject from the specified parameters. |
XMLSignature |
newXMLSignature(SignedInfo si,
KeyInfo ki)
Creates an
XMLSignature and initializes it with the contents
of the specified SignedInfo and KeyInfo
objects. |
XMLSignature |
newXMLSignature(SignedInfo si,
KeyInfo ki,
List objects,
String id,
String signatureValueId)
Creates an
XMLSignature and initializes it with the
specified parameters. |
XMLSignature |
unmarshalXMLSignature(XMLStructure xmlStructure)
Unmarshals a new
XMLSignature instance from a
mechanism-specific XMLStructure instance. |
XMLSignature |
unmarshalXMLSignature(XMLValidateContext context)
Unmarshals a new
XMLSignature instance from a
mechanism-specific XMLValidateContext instance. |
getInstance, getInstance, getInstance, getInstance, getKeyInfoFactory, getMechanismType, getProviderpublic DOMXMLSignatureFactory()
public XMLSignature newXMLSignature(SignedInfo si, KeyInfo ki)
XMLSignatureFactoryXMLSignature and initializes it with the contents
of the specified SignedInfo and KeyInfo
objects.newXMLSignature in class XMLSignatureFactorysi - the signed infoki - the key info (may be null)XMLSignaturepublic XMLSignature newXMLSignature(SignedInfo si, KeyInfo ki, List objects, String id, String signatureValueId)
XMLSignatureFactoryXMLSignature and initializes it with the
specified parameters.newXMLSignature in class XMLSignatureFactorysi - the signed infoki - the key info (may be null)objects - a list of XMLObjects (may be empty or
null)id - the Id (may be null)signatureValueId - the SignatureValue Id (may be null)XMLSignaturepublic Reference newReference(String uri, DigestMethod dm)
XMLSignatureFactoryReference with the specified URI and digest
method.newReference in class XMLSignatureFactoryuri - the reference URI (may be null)dm - the digest methodReferencepublic Reference newReference(String uri, DigestMethod dm, List transforms, String type, String id)
XMLSignatureFactoryReference with the specified parameters.newReference in class XMLSignatureFactoryuri - the reference URI (may be null)dm - the digest methodtransforms - a list of Transforms. The list is defensively
copied to protect against subsequent modification. May be
null or empty.type - the reference type, as a URI (may be null)id - the reference ID (may be null)Referencepublic Reference newReference(String uri, DigestMethod dm, List appliedTransforms, Data result, List transforms, String type, String id)
XMLSignatureFactoryReference with the specified parameters.
This method is useful when a list of transforms have already been
applied to the Reference. See for example,
the
OASIS-DSS (Digital Signature Services) specification.
When an XMLSignature containing this reference is
generated, the specified transforms (if non-null) are
applied to the specified result. The
Transforms element of the resulting Reference
element is set to the concatenation of the
appliedTransforms and transforms.
newReference in class XMLSignatureFactoryuri - the reference URI (may be null)dm - the digest methodappliedTransforms - a list of Transforms that have
already been applied. The list is defensively
copied to protect against subsequent modification. The list must
contain at least one entry.result - the result of processing the sequence of
appliedTransformstransforms - a list of Transforms that are to be applied
when generating the signature. The list is defensively copied to
protect against subsequent modification. May be null
or empty.type - the reference type, as a URI (may be null)id - the reference ID (may be null)Referencepublic Reference newReference(String uri, DigestMethod dm, List transforms, String type, String id, byte[] digestValue)
XMLSignatureFactoryReference with the specified parameters and
pre-calculated digest value.
This method is useful when the digest value of a
Reference has been previously computed. See for example,
the
OASIS-DSS (Digital Signature Services) specification.
newReference in class XMLSignatureFactoryuri - the reference URI (may be null)dm - the digest methodtransforms - a list of Transforms. The list is defensively
copied to protect against subsequent modification. May be
null or empty.type - the reference type, as a URI (may be null)id - the reference ID (may be null)digestValue - the digest value. The array is cloned to protect
against subsequent modification.Referencepublic SignedInfo newSignedInfo(CanonicalizationMethod cm, SignatureMethod sm, List references)
XMLSignatureFactorySignedInfo with the specified canonicalization
and signature methods, and list of one or more references.newSignedInfo in class XMLSignatureFactorycm - the canonicalization methodsm - the signature methodreferences - a list of one or more References. The list is
defensively copied to protect against subsequent modification.SignedInfopublic SignedInfo newSignedInfo(CanonicalizationMethod cm, SignatureMethod sm, List references, String id)
XMLSignatureFactorySignedInfo with the specified parameters.newSignedInfo in class XMLSignatureFactorycm - the canonicalization methodsm - the signature methodreferences - a list of one or more References. The list is
defensively copied to protect against subsequent modification.id - the id (may be null)SignedInfopublic XMLObject newXMLObject(List content, String id, String mimeType, String encoding)
XMLSignatureFactoryXMLObject from the specified parameters.newXMLObject in class XMLSignatureFactorycontent - a list of XMLStructures. The list
is defensively copied to protect against subsequent modification.
May be null or empty.id - the Id (may be null)mimeType - the mime type (may be null)encoding - the encoding (may be null)XMLObjectpublic Manifest newManifest(List references)
XMLSignatureFactoryManifest containing the specified
list of References.newManifest in class XMLSignatureFactoryreferences - a list of one or more References. The list
is defensively copied to protect against subsequent modification.Manifestpublic Manifest newManifest(List references, String id)
XMLSignatureFactoryManifest containing the specified
list of References and optional id.newManifest in class XMLSignatureFactoryreferences - a list of one or more References. The list
is defensively copied to protect against subsequent modification.id - the id (may be null)Manifestpublic SignatureProperties newSignatureProperties(List props, String id)
XMLSignatureFactorySignatureProperties containing the specified
list of SignaturePropertys and optional id.newSignatureProperties in class XMLSignatureFactoryprops - a list of one or more SignaturePropertys.
The list is defensively copied to protect against subsequent
modification.id - the id (may be null)SignaturePropertiespublic SignatureProperty newSignatureProperty(List info, String target, String id)
XMLSignatureFactorySignatureProperty containing the specified
list of XMLStructures, target URI and optional id.newSignatureProperty in class XMLSignatureFactoryinfo - a list of one or more XMLStructures. The list
is defensively copied to protect against subsequent modification.target - the target URI of the Signature that this property applies
toid - the id (may be null)SignaturePropertypublic XMLSignature unmarshalXMLSignature(XMLValidateContext context) throws MarshalException
XMLSignatureFactoryXMLSignature instance from a
mechanism-specific XMLValidateContext instance.unmarshalXMLSignature in class XMLSignatureFactorycontext - a mechanism-specific context from which to unmarshal the
signature fromXMLSignatureMarshalException - if an unrecoverable exception occurs
during unmarshallingpublic XMLSignature unmarshalXMLSignature(XMLStructure xmlStructure) throws MarshalException
XMLSignatureFactoryXMLSignature instance from a
mechanism-specific XMLStructure instance.
This method is useful if you only want to unmarshal (and not
validate) an XMLSignature.unmarshalXMLSignature in class XMLSignatureFactoryxmlStructure - a mechanism-specific XML structure from which to
unmarshal the signature fromXMLSignatureMarshalException - if an unrecoverable exception occurs
during unmarshallingpublic boolean isFeatureSupported(String feature)
XMLSignatureFactoryisFeatureSupported in class XMLSignatureFactoryfeature - the feature name (as an absolute URI)true if the specified feature is supported,
false otherwisepublic DigestMethod newDigestMethod(String algorithm, DigestMethodParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
XMLSignatureFactoryDigestMethod for the specified algorithm URI
and parameters.newDigestMethod in class XMLSignatureFactoryalgorithm - the URI identifying the digest algorithmparams - algorithm-specific digest parameters (may be
null)DigestMethodNoSuchAlgorithmException - if an implementation of the
specified algorithm cannot be foundInvalidAlgorithmParameterException - if the specified parameters
are inappropriate for the requested algorithmpublic SignatureMethod newSignatureMethod(String algorithm, SignatureMethodParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
XMLSignatureFactorySignatureMethod for the specified algorithm URI
and parameters.newSignatureMethod in class XMLSignatureFactoryalgorithm - the URI identifying the signature algorithmparams - algorithm-specific signature parameters (may be
null)SignatureMethodNoSuchAlgorithmException - if an implementation of the
specified algorithm cannot be foundInvalidAlgorithmParameterException - if the specified parameters
are inappropriate for the requested algorithmpublic Transform newTransform(String algorithm, TransformParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
XMLSignatureFactoryTransform for the specified algorithm URI
and parameters.newTransform in class XMLSignatureFactoryalgorithm - the URI identifying the transform algorithmparams - algorithm-specific transform parameters (may be
null)TransformNoSuchAlgorithmException - if an implementation of the
specified algorithm cannot be foundInvalidAlgorithmParameterException - if the specified parameters
are inappropriate for the requested algorithmpublic Transform newTransform(String algorithm, XMLStructure params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
XMLSignatureFactoryTransform for the specified algorithm URI
and parameters. The parameters are specified as a mechanism-specific
XMLStructure (ex: DOMStructure). This method is
useful when the parameters are in XML form or there is no standard
class for specifying the parameters.newTransform in class XMLSignatureFactoryalgorithm - the URI identifying the transform algorithmparams - a mechanism-specific XML structure from which to
unmarshal the parameters from (may be null if
not required or optional)TransformNoSuchAlgorithmException - if an implementation of the
specified algorithm cannot be foundInvalidAlgorithmParameterException - if the specified parameters
are inappropriate for the requested algorithmpublic CanonicalizationMethod newCanonicalizationMethod(String algorithm, C14NMethodParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
XMLSignatureFactoryCanonicalizationMethod for the specified
algorithm URI and parameters.newCanonicalizationMethod in class XMLSignatureFactoryalgorithm - the URI identifying the canonicalization algorithmparams - algorithm-specific canonicalization parameters (may be
null)CanonicalizationMethodNoSuchAlgorithmException - if an implementation of the
specified algorithm cannot be foundInvalidAlgorithmParameterException - if the specified parameters
are inappropriate for the requested algorithmpublic CanonicalizationMethod newCanonicalizationMethod(String algorithm, XMLStructure params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
XMLSignatureFactoryCanonicalizationMethod for the specified
algorithm URI and parameters. The parameters are specified as a
mechanism-specific XMLStructure (ex: DOMStructure).
This method is useful when the parameters are in XML form or there is
no standard class for specifying the parameters.newCanonicalizationMethod in class XMLSignatureFactoryalgorithm - the URI identifying the canonicalization algorithmparams - a mechanism-specific XML structure from which to
unmarshal the parameters from (may be null if
not required or optional)CanonicalizationMethodNoSuchAlgorithmException - if an implementation of the
specified algorithm cannot be foundInvalidAlgorithmParameterException - if the specified parameters
are inappropriate for the requested algorithmpublic URIDereferencer getURIDereferencer()
XMLSignatureFactoryURIDereferencer that is used by
default to dereference URIs in Reference objects.getURIDereferencer in class XMLSignatureFactoryURIDereferencer (never
null)Copyright © 2000–2022 The Apache Software Foundation. All rights reserved.