Class DOMXMLSignature
- java.lang.Object
-
- org.apache.jcp.xml.dsig.internal.dom.DOMStructure
-
- org.apache.jcp.xml.dsig.internal.dom.DOMXMLSignature
-
- All Implemented Interfaces:
javax.xml.crypto.dsig.XMLSignature
,javax.xml.crypto.XMLStructure
public final class DOMXMLSignature extends DOMStructure implements javax.xml.crypto.dsig.XMLSignature
DOM-based implementation of XMLSignature.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
DOMXMLSignature.DOMSignatureValue
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
id
private javax.xml.crypto.dsig.keyinfo.KeyInfo
ki
private javax.xml.crypto.KeySelectorResult
ksr
private org.w3c.dom.Element
localSigElem
private static org.slf4j.Logger
LOG
private java.util.List<javax.xml.crypto.dsig.XMLObject>
objects
private org.w3c.dom.Document
ownerDoc
private javax.xml.crypto.dsig.SignedInfo
si
private org.w3c.dom.Element
sigElem
private java.util.Map<java.lang.String,javax.xml.crypto.XMLStructure>
signatureIdMap
private javax.xml.crypto.dsig.XMLSignature.SignatureValue
sv
private boolean
validated
private boolean
validationStatus
-
Constructor Summary
Constructors Constructor Description DOMXMLSignature(javax.xml.crypto.dsig.SignedInfo si, javax.xml.crypto.dsig.keyinfo.KeyInfo ki, java.util.List<? extends javax.xml.crypto.dsig.XMLObject> objs, java.lang.String id, java.lang.String signatureValueId)
Creates aDOMXMLSignature
from the specified components.DOMXMLSignature(org.w3c.dom.Element sigElem, javax.xml.crypto.XMLCryptoContext context, java.security.Provider provider)
Creates aDOMXMLSignature
from XML.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
digestReference(DOMReference ref, javax.xml.crypto.dsig.XMLSignContext signContext)
boolean
equals(java.lang.Object o)
java.lang.String
getId()
javax.xml.crypto.dsig.keyinfo.KeyInfo
getKeyInfo()
javax.xml.crypto.KeySelectorResult
getKeySelectorResult()
java.util.List<javax.xml.crypto.dsig.XMLObject>
getObjects()
javax.xml.crypto.dsig.XMLSignature.SignatureValue
getSignatureValue()
javax.xml.crypto.dsig.SignedInfo
getSignedInfo()
int
hashCode()
void
marshal(org.w3c.dom.Node parent, java.lang.String dsPrefix, javax.xml.crypto.dom.DOMCryptoContext context)
void
marshal(org.w3c.dom.Node parent, org.w3c.dom.Node nextSibling, java.lang.String dsPrefix, javax.xml.crypto.dom.DOMCryptoContext context)
void
sign(javax.xml.crypto.dsig.XMLSignContext signContext)
boolean
validate(javax.xml.crypto.dsig.XMLValidateContext vc)
-
Methods inherited from class org.apache.jcp.xml.dsig.internal.dom.DOMStructure
isFeatureSupported
-
-
-
-
Field Detail
-
LOG
private static final org.slf4j.Logger LOG
-
id
private java.lang.String id
-
sv
private javax.xml.crypto.dsig.XMLSignature.SignatureValue sv
-
ki
private javax.xml.crypto.dsig.keyinfo.KeyInfo ki
-
objects
private java.util.List<javax.xml.crypto.dsig.XMLObject> objects
-
si
private javax.xml.crypto.dsig.SignedInfo si
-
ownerDoc
private org.w3c.dom.Document ownerDoc
-
localSigElem
private org.w3c.dom.Element localSigElem
-
sigElem
private org.w3c.dom.Element sigElem
-
validationStatus
private boolean validationStatus
-
validated
private boolean validated
-
ksr
private javax.xml.crypto.KeySelectorResult ksr
-
signatureIdMap
private java.util.Map<java.lang.String,javax.xml.crypto.XMLStructure> signatureIdMap
-
-
Constructor Detail
-
DOMXMLSignature
public DOMXMLSignature(javax.xml.crypto.dsig.SignedInfo si, javax.xml.crypto.dsig.keyinfo.KeyInfo ki, java.util.List<? extends javax.xml.crypto.dsig.XMLObject> objs, java.lang.String id, java.lang.String signatureValueId)
Creates aDOMXMLSignature
from the specified components.- Parameters:
si
- theSignedInfo
ki
- theKeyInfo
, ornull
if not specifiedobjs
- a list ofXMLObject
s ornull
if not specified. The list is copied to protect against subsequent modification.id
- an optional id (specifynull
to omit)signatureValueId
- an optional id (specifynull
to omit)- Throws:
java.lang.NullPointerException
- ifsi
isnull
-
DOMXMLSignature
public DOMXMLSignature(org.w3c.dom.Element sigElem, javax.xml.crypto.XMLCryptoContext context, java.security.Provider provider) throws javax.xml.crypto.MarshalException
Creates aDOMXMLSignature
from XML.- Parameters:
sigElem
- Signature element- Throws:
javax.xml.crypto.MarshalException
- if XMLSignature cannot be unmarshalled
-
-
Method Detail
-
getId
public java.lang.String getId()
- Specified by:
getId
in interfacejavax.xml.crypto.dsig.XMLSignature
-
getKeyInfo
public javax.xml.crypto.dsig.keyinfo.KeyInfo getKeyInfo()
- Specified by:
getKeyInfo
in interfacejavax.xml.crypto.dsig.XMLSignature
-
getSignedInfo
public javax.xml.crypto.dsig.SignedInfo getSignedInfo()
- Specified by:
getSignedInfo
in interfacejavax.xml.crypto.dsig.XMLSignature
-
getObjects
public java.util.List<javax.xml.crypto.dsig.XMLObject> getObjects()
- Specified by:
getObjects
in interfacejavax.xml.crypto.dsig.XMLSignature
-
getSignatureValue
public javax.xml.crypto.dsig.XMLSignature.SignatureValue getSignatureValue()
- Specified by:
getSignatureValue
in interfacejavax.xml.crypto.dsig.XMLSignature
-
getKeySelectorResult
public javax.xml.crypto.KeySelectorResult getKeySelectorResult()
- Specified by:
getKeySelectorResult
in interfacejavax.xml.crypto.dsig.XMLSignature
-
marshal
public void marshal(org.w3c.dom.Node parent, java.lang.String dsPrefix, javax.xml.crypto.dom.DOMCryptoContext context) throws javax.xml.crypto.MarshalException
- Specified by:
marshal
in classDOMStructure
- Throws:
javax.xml.crypto.MarshalException
-
marshal
public void marshal(org.w3c.dom.Node parent, org.w3c.dom.Node nextSibling, java.lang.String dsPrefix, javax.xml.crypto.dom.DOMCryptoContext context) throws javax.xml.crypto.MarshalException
- Throws:
javax.xml.crypto.MarshalException
-
validate
public boolean validate(javax.xml.crypto.dsig.XMLValidateContext vc) throws javax.xml.crypto.dsig.XMLSignatureException
- Specified by:
validate
in interfacejavax.xml.crypto.dsig.XMLSignature
- Throws:
javax.xml.crypto.dsig.XMLSignatureException
-
sign
public void sign(javax.xml.crypto.dsig.XMLSignContext signContext) throws javax.xml.crypto.MarshalException, javax.xml.crypto.dsig.XMLSignatureException
- Specified by:
sign
in interfacejavax.xml.crypto.dsig.XMLSignature
- Throws:
javax.xml.crypto.MarshalException
javax.xml.crypto.dsig.XMLSignatureException
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
digestReference
private void digestReference(DOMReference ref, javax.xml.crypto.dsig.XMLSignContext signContext) throws javax.xml.crypto.dsig.XMLSignatureException
- Throws:
javax.xml.crypto.dsig.XMLSignatureException
-
-