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 classDOMXMLSignature.DOMSignatureValue
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringidprivate javax.xml.crypto.dsig.keyinfo.KeyInfokiprivate javax.xml.crypto.KeySelectorResultksrprivate org.w3c.dom.ElementlocalSigElemprivate static org.slf4j.LoggerLOGprivate java.util.List<javax.xml.crypto.dsig.XMLObject>objectsprivate org.w3c.dom.DocumentownerDocprivate javax.xml.crypto.dsig.SignedInfosiprivate org.w3c.dom.ElementsigElemprivate java.util.Map<java.lang.String,javax.xml.crypto.XMLStructure>signatureIdMapprivate javax.xml.crypto.dsig.XMLSignature.SignatureValuesvprivate booleanvalidatedprivate booleanvalidationStatus
-
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 aDOMXMLSignaturefrom the specified components.DOMXMLSignature(org.w3c.dom.Element sigElem, javax.xml.crypto.XMLCryptoContext context, java.security.Provider provider)Creates aDOMXMLSignaturefrom XML.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voiddigestReference(DOMReference ref, javax.xml.crypto.dsig.XMLSignContext signContext)booleanequals(java.lang.Object o)java.lang.StringgetId()javax.xml.crypto.dsig.keyinfo.KeyInfogetKeyInfo()javax.xml.crypto.KeySelectorResultgetKeySelectorResult()java.util.List<javax.xml.crypto.dsig.XMLObject>getObjects()javax.xml.crypto.dsig.XMLSignature.SignatureValuegetSignatureValue()javax.xml.crypto.dsig.SignedInfogetSignedInfo()inthashCode()voidmarshal(org.w3c.dom.Node parent, java.lang.String dsPrefix, javax.xml.crypto.dom.DOMCryptoContext context)voidmarshal(org.w3c.dom.Node parent, org.w3c.dom.Node nextSibling, java.lang.String dsPrefix, javax.xml.crypto.dom.DOMCryptoContext context)voidsign(javax.xml.crypto.dsig.XMLSignContext signContext)booleanvalidate(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 aDOMXMLSignaturefrom the specified components.- Parameters:
si- theSignedInfoki- theKeyInfo, ornullif not specifiedobjs- a list ofXMLObjects ornullif not specified. The list is copied to protect against subsequent modification.id- an optional id (specifynullto omit)signatureValueId- an optional id (specifynullto omit)- Throws:
java.lang.NullPointerException- ifsiisnull
-
DOMXMLSignature
public DOMXMLSignature(org.w3c.dom.Element sigElem, javax.xml.crypto.XMLCryptoContext context, java.security.Provider provider) throws javax.xml.crypto.MarshalExceptionCreates aDOMXMLSignaturefrom 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:
getIdin interfacejavax.xml.crypto.dsig.XMLSignature
-
getKeyInfo
public javax.xml.crypto.dsig.keyinfo.KeyInfo getKeyInfo()
- Specified by:
getKeyInfoin interfacejavax.xml.crypto.dsig.XMLSignature
-
getSignedInfo
public javax.xml.crypto.dsig.SignedInfo getSignedInfo()
- Specified by:
getSignedInfoin interfacejavax.xml.crypto.dsig.XMLSignature
-
getObjects
public java.util.List<javax.xml.crypto.dsig.XMLObject> getObjects()
- Specified by:
getObjectsin interfacejavax.xml.crypto.dsig.XMLSignature
-
getSignatureValue
public javax.xml.crypto.dsig.XMLSignature.SignatureValue getSignatureValue()
- Specified by:
getSignatureValuein interfacejavax.xml.crypto.dsig.XMLSignature
-
getKeySelectorResult
public javax.xml.crypto.KeySelectorResult getKeySelectorResult()
- Specified by:
getKeySelectorResultin 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:
marshalin 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:
validatein 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:
signin interfacejavax.xml.crypto.dsig.XMLSignature- Throws:
javax.xml.crypto.MarshalExceptionjavax.xml.crypto.dsig.XMLSignatureException
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein 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
-
-