|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.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 Reference s. |
Manifest |
newManifest(List references,
String id)
Creates a Manifest containing the specified
list of Reference s 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 SignatureProperty s and optional id. |
SignatureProperty |
newSignatureProperty(List info,
String target,
String id)
Creates a SignatureProperty containing the specified
list of XMLStructure s, 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)
XMLSignatureFactory
XMLSignature
and initializes it with the contents
of the specified SignedInfo
and KeyInfo
objects.
newXMLSignature
in class XMLSignatureFactory
si
- the signed infoki
- the key info (may be null
)
XMLSignature
public XMLSignature newXMLSignature(SignedInfo si, KeyInfo ki, List objects, String id, String signatureValueId)
XMLSignatureFactory
XMLSignature
and initializes it with the
specified parameters.
newXMLSignature
in class XMLSignatureFactory
si
- the signed infoki
- the key info (may be null
)objects
- a list of XMLObject
s (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)
XMLSignatureFactory
Reference
with the specified URI and digest
method.
newReference
in class XMLSignatureFactory
uri
- the reference URI (may be null
)dm
- the digest method
Reference
public Reference newReference(String uri, DigestMethod dm, List transforms, String type, String id)
XMLSignatureFactory
Reference
with the specified parameters.
newReference
in class XMLSignatureFactory
uri
- the reference URI (may be null
)dm
- the digest methodtransforms
- a list of Transform
s. 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)
XMLSignatureFactory
Reference
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 XMLSignatureFactory
uri
- the reference URI (may be null
)dm
- the digest methodappliedTransforms
- a list of Transform
s 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
appliedTransforms
transforms
- a list of Transform
s 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)
XMLSignatureFactory
Reference
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 XMLSignatureFactory
uri
- the reference URI (may be null
)dm
- the digest methodtransforms
- a list of Transform
s. 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)
XMLSignatureFactory
SignedInfo
with the specified canonicalization
and signature methods, and list of one or more references.
newSignedInfo
in class XMLSignatureFactory
cm
- the canonicalization methodsm
- the signature methodreferences
- a list of one or more Reference
s. The list is
defensively copied to protect against subsequent modification.
SignedInfo
public SignedInfo newSignedInfo(CanonicalizationMethod cm, SignatureMethod sm, List references, String id)
XMLSignatureFactory
SignedInfo
with the specified parameters.
newSignedInfo
in class XMLSignatureFactory
cm
- the canonicalization methodsm
- the signature methodreferences
- a list of one or more Reference
s. 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)
XMLSignatureFactory
XMLObject
from the specified parameters.
newXMLObject
in class XMLSignatureFactory
content
- a list of XMLStructure
s. 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
)
XMLObject
public Manifest newManifest(List references)
XMLSignatureFactory
Manifest
containing the specified
list of Reference
s.
newManifest
in class XMLSignatureFactory
references
- a list of one or more Reference
s. The list
is defensively copied to protect against subsequent modification.
Manifest
public Manifest newManifest(List references, String id)
XMLSignatureFactory
Manifest
containing the specified
list of Reference
s and optional id.
newManifest
in class XMLSignatureFactory
references
- a list of one or more Reference
s. The list
is defensively copied to protect against subsequent modification.id
- the id (may be null
)
Manifest
public SignatureProperties newSignatureProperties(List props, String id)
XMLSignatureFactory
SignatureProperties
containing the specified
list of SignatureProperty
s and optional id.
newSignatureProperties
in class XMLSignatureFactory
props
- a list of one or more SignatureProperty
s.
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)
XMLSignatureFactory
SignatureProperty
containing the specified
list of XMLStructure
s, target URI and optional id.
newSignatureProperty
in class XMLSignatureFactory
info
- a list of one or more XMLStructure
s. 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
XMLSignatureFactory
XMLSignature
instance from a
mechanism-specific XMLValidateContext
instance.
unmarshalXMLSignature
in class XMLSignatureFactory
context
- a mechanism-specific context from which to unmarshal the
signature from
XMLSignature
MarshalException
- if an unrecoverable exception occurs
during unmarshallingpublic XMLSignature unmarshalXMLSignature(XMLStructure xmlStructure) throws MarshalException
XMLSignatureFactory
XMLSignature
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 XMLSignatureFactory
xmlStructure
- 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 XMLSignatureFactory
feature
- 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
XMLSignatureFactory
DigestMethod
for the specified algorithm URI
and parameters.
newDigestMethod
in class XMLSignatureFactory
algorithm
- 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 algorithmpublic SignatureMethod newSignatureMethod(String algorithm, SignatureMethodParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
XMLSignatureFactory
SignatureMethod
for the specified algorithm URI
and parameters.
newSignatureMethod
in class XMLSignatureFactory
algorithm
- 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 algorithmpublic Transform newTransform(String algorithm, TransformParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
XMLSignatureFactory
Transform
for the specified algorithm URI
and parameters.
newTransform
in class XMLSignatureFactory
algorithm
- 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 algorithmpublic Transform newTransform(String algorithm, XMLStructure params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
XMLSignatureFactory
Transform
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 XMLSignatureFactory
algorithm
- 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 algorithmpublic CanonicalizationMethod newCanonicalizationMethod(String algorithm, C14NMethodParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
XMLSignatureFactory
CanonicalizationMethod
for the specified
algorithm URI and parameters.
newCanonicalizationMethod
in class XMLSignatureFactory
algorithm
- 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 algorithmpublic CanonicalizationMethod newCanonicalizationMethod(String algorithm, XMLStructure params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
XMLSignatureFactory
CanonicalizationMethod
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 XMLSignatureFactory
algorithm
- 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()
XMLSignatureFactory
URIDereferencer
that is used by
default to dereference URIs in Reference
objects.
getURIDereferencer
in class XMLSignatureFactory
URIDereferencer
(never
null
)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |