|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.xml.crypto.dsig.XMLSignatureFactory
org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory
public final class DOMXMLSignatureFactory
Disabled: no SafeJ information.
DOM-based implementation of XMLSignatureFactory.
| Constructor Summary | |
|---|---|
DOMXMLSignatureFactory()
Initializes a new instance of this class. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class javax.xml.crypto.dsig.XMLSignatureFactory |
|---|
getInstance, getInstance, getInstance, getInstance, getKeyInfoFactory, getMechanismType, getProvider |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DOMXMLSignatureFactory()
| Method Detail |
|---|
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)
XMLSignature
public 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)
XMLSignature
public 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 method
Reference
public 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)
Reference
public 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)
Reference
public 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.
Reference
public 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.
SignedInfo
public 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)
SignedInfo
public 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.
Manifest
public 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)
Manifest
public 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)
SignatureProperties
public 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)
SignatureProperty
public 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 from
XMLSignature
MarshalException - if an unrecoverable exception occurs
during unmarshalling
public 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 from
XMLSignature
MarshalException - if an unrecoverable exception occurs
during unmarshallingpublic boolean isFeatureSupported(String feature)
XMLSignatureFactory
isFeatureSupported in class XMLSignatureFactoryfeature - the feature name (as an absolute URI)
true if the specified feature is supported,
false otherwise
public 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)
DigestMethod
NoSuchAlgorithmException - if an implementation of the
specified algorithm cannot be found
InvalidAlgorithmParameterException - if the specified parameters
are inappropriate for the requested algorithm
public 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)
SignatureMethod
NoSuchAlgorithmException - if an implementation of the
specified algorithm cannot be found
InvalidAlgorithmParameterException - if the specified parameters
are inappropriate for the requested algorithm
public 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)
Transform
NoSuchAlgorithmException - if an implementation of the
specified algorithm cannot be found
InvalidAlgorithmParameterException - if the specified parameters
are inappropriate for the requested algorithm
public 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)
Transform
NoSuchAlgorithmException - if an implementation of the
specified algorithm cannot be found
InvalidAlgorithmParameterException - if the specified parameters
are inappropriate for the requested algorithm
public 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)
CanonicalizationMethod
NoSuchAlgorithmException - if an implementation of the
specified algorithm cannot be found
InvalidAlgorithmParameterException - if the specified parameters
are inappropriate for the requested algorithm
public 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)
CanonicalizationMethod
NoSuchAlgorithmException - if an implementation of the
specified algorithm cannot be found
InvalidAlgorithmParameterException - 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)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||