public class XMLSignatureFactory extends XMLSignatureFactory
XMLSignatureFactory that supports the DOM
XML representation and marshaling mechanism.| Constructor and Description |
|---|
XMLSignatureFactory() |
| Modifier and Type | Method and Description |
|---|---|
URIDereferencer |
getURIDereferencer()
Returns a reference to the
URIDereferencer that is used by
default to dereference URIs in Referenceobjects. |
boolean |
isFeatureSupported(String arg0)
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 properties,
String id)
Creates a
SignatureProperties containing the specified list of
SignaturePropertys and optional id. |
SignatureProperty |
newSignatureProperty(List content,
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 XMLSignature newXMLSignature(SignedInfo si, KeyInfo ki)
javax.xml.crypto.dsig.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)XMLSignatureXMLSignatureFactory.newXMLSignature(javax.xml.crypto.dsig.SignedInfo,
javax.xml.crypto.dsig.keyinfo.KeyInfo)public XMLSignature newXMLSignature(SignedInfo si, KeyInfo ki, List objects, String id, String signatureValueId)
javax.xml.crypto.dsig.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)XMLSignatureXMLSignatureFactory.newXMLSignature(javax.xml.crypto.dsig.SignedInfo,
javax.xml.crypto.dsig.keyinfo.KeyInfo, java.util.List,
java.lang.String, java.lang.String)public Reference newReference(String uri, DigestMethod dm)
javax.xml.crypto.dsig.XMLSignatureFactoryReference with the specified URI and digest method.newReference in class XMLSignatureFactoryuri - the reference URI (may be null)dm - the digest methodReferenceXMLSignatureFactory.newReference(java.lang.String,
javax.xml.crypto.dsig.DigestMethod)public Reference newReference(String uri, DigestMethod dm, List transforms, String type, String id)
javax.xml.crypto.dsig.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)ReferenceXMLSignatureFactory.newReference(java.lang.String,
javax.xml.crypto.dsig.DigestMethod, java.util.List, java.lang.String,
java.lang.String)public Reference newReference(String uri, DigestMethod dm, List transforms, String type, String id, byte[] digestValue)
javax.xml.crypto.dsig.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.ReferenceXMLSignatureFactory.newReference(java.lang.String,
javax.xml.crypto.dsig.DigestMethod, java.util.List, java.lang.String,
java.lang.String, byte[])public Reference newReference(String uri, DigestMethod dm, List appliedTransforms, Data result, List transforms, String type, String id)
javax.xml.crypto.dsig.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. May be null or empty in wich case the
result coresponds to the dereferenced Data.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)ReferenceXMLSignatureFactory.newReference(java.lang.String,
javax.xml.crypto.dsig.DigestMethod, java.util.List,
javax.xml.crypto.Data, java.util.List, java.lang.String,
java.lang.String)public SignedInfo newSignedInfo(CanonicalizationMethod cm, SignatureMethod sm, List references)
javax.xml.crypto.dsig.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.SignedInfoXMLSignatureFactory.newSignedInfo(javax.xml.crypto.dsig.CanonicalizationMethod,
javax.xml.crypto.dsig.SignatureMethod, java.util.List)public SignedInfo newSignedInfo(CanonicalizationMethod cm, SignatureMethod sm, List references, String id)
javax.xml.crypto.dsig.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)SignedInfoXMLSignatureFactory.newSignedInfo(javax.xml.crypto.dsig.CanonicalizationMethod,
javax.xml.crypto.dsig.SignatureMethod, java.util.List,
java.lang.String)public XMLObject newXMLObject(List content, String id, String mimeType, String encoding)
javax.xml.crypto.dsig.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)XMLObjectXMLSignatureFactory.newXMLObject(java.util.List,
java.lang.String, java.lang.String, java.lang.String)public Manifest newManifest(List references)
javax.xml.crypto.dsig.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.ManifestXMLSignatureFactory.newManifest(java.util.List)public Manifest newManifest(List references, String id)
javax.xml.crypto.dsig.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)ManifestXMLSignatureFactory.newManifest(java.util.List,
java.lang.String)public SignatureProperty newSignatureProperty(List content, String target, String id)
javax.xml.crypto.dsig.XMLSignatureFactorySignatureProperty containing the specified list of
XMLStructures, target URI and optional id.newSignatureProperty in class XMLSignatureFactorycontent - 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)SignaturePropertyXMLSignatureFactory.newSignatureProperty(java.util.List,
java.lang.String, java.lang.String)public SignatureProperties newSignatureProperties(List properties, String id)
javax.xml.crypto.dsig.XMLSignatureFactorySignatureProperties containing the specified list of
SignaturePropertys and optional id.newSignatureProperties in class XMLSignatureFactoryproperties - a list of one or more SignaturePropertys. The list is
defensively copied to protect against subsequent modification.id - the id (may be null)SignaturePropertiesXMLSignatureFactory.newSignatureProperties(java.util.List,
java.lang.String)public DigestMethod newDigestMethod(String algorithm, DigestMethodParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
javax.xml.crypto.dsig.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
algorithmXMLSignatureFactory.newDigestMethod(java.lang.String,
javax.xml.crypto.dsig.spec.DigestMethodParameterSpec)public SignatureMethod newSignatureMethod(String algorithm, SignatureMethodParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
javax.xml.crypto.dsig.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
algorithmXMLSignatureFactory.newSignatureMethod(java.lang.String,
javax.xml.crypto.dsig.spec.SignatureMethodParameterSpec)public Transform newTransform(String algorithm, TransformParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
javax.xml.crypto.dsig.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
algorithmXMLSignatureFactory.newTransform(java.lang.String,
javax.xml.crypto.dsig.spec.TransformParameterSpec)public Transform newTransform(String algorithm, XMLStructure params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
javax.xml.crypto.dsig.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
algorithmXMLSignatureFactory.newTransform(java.lang.String,
javax.xml.crypto.XMLStructure)public CanonicalizationMethod newCanonicalizationMethod(String algorithm, C14NMethodParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
javax.xml.crypto.dsig.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
algorithmXMLSignatureFactory.newCanonicalizationMethod(java.lang.String,
javax.xml.crypto.dsig.spec.C14NMethodParameterSpec)public CanonicalizationMethod newCanonicalizationMethod(String algorithm, XMLStructure params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
javax.xml.crypto.dsig.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
algorithmXMLSignatureFactory.newCanonicalizationMethod(java.lang.String,
javax.xml.crypto.XMLStructure)public XMLSignature unmarshalXMLSignature(XMLValidateContext context) throws MarshalException
javax.xml.crypto.dsig.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 unmarshallingXMLSignatureFactory.unmarshalXMLSignature(javax.xml.crypto.dsig.XMLValidateContext)public XMLSignature unmarshalXMLSignature(XMLStructure xmlStructure) throws MarshalException
javax.xml.crypto.dsig.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 unmarshallingXMLSignatureFactory.unmarshalXMLSignature(javax.xml.crypto.XMLStructure)public boolean isFeatureSupported(String arg0)
javax.xml.crypto.dsig.XMLSignatureFactoryisFeatureSupported in class XMLSignatureFactoryarg0 - the feature name (as an absolute URI)true if the specified feature is supported,
false otherwiseXMLSignatureFactory.isFeatureSupported(java.lang.String)public URIDereferencer getURIDereferencer()
javax.xml.crypto.dsig.XMLSignatureFactoryURIDereferencer that is used by
default to dereference URIs in Referenceobjects.getURIDereferencer in class XMLSignatureFactoryURIDereferencer (never
null)XMLSignatureFactory.getURIDereferencer()© 2002-2005 IAIK, © 2004, 2006 - 2019 Stiftung SIC