public final class DOMXMLSignature extends DOMStructure implements XMLSignature
| Modifier and Type | Class and Description |
|---|---|
class |
DOMXMLSignature.DOMSignatureValue |
XMLSignature.SignatureValueXMLNS| Constructor and Description |
|---|
DOMXMLSignature(Element sigElem,
XMLCryptoContext context,
Provider provider)
Creates a
DOMXMLSignature from XML. |
DOMXMLSignature(SignedInfo si,
KeyInfo ki,
List<? extends XMLObject> objs,
String id,
String signatureValueId)
Creates a
DOMXMLSignature from the specified components. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
String |
getId()
Returns the optional Id of this
XMLSignature. |
KeyInfo |
getKeyInfo()
Returns the key info of this
XMLSignature. |
KeySelectorResult |
getKeySelectorResult()
Returns the result of the
KeySelector, if specified, after
this XMLSignature has been signed or validated. |
List |
getObjects()
|
XMLSignature.SignatureValue |
getSignatureValue()
Returns the signature value of this
XMLSignature. |
SignedInfo |
getSignedInfo()
Returns the signed info of this
XMLSignature. |
int |
hashCode() |
void |
marshal(Node parent,
Node nextSibling,
String dsPrefix,
DOMCryptoContext context) |
void |
marshal(Node parent,
String dsPrefix,
DOMCryptoContext context) |
void |
sign(XMLSignContext signContext)
Signs this
XMLSignature. |
boolean |
validate(XMLValidateContext vc)
Validates the signature according to the
core validation processing rules.
|
isFeatureSupportedclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitisFeatureSupportedpublic DOMXMLSignature(SignedInfo si, KeyInfo ki, List<? extends XMLObject> objs, String id, String signatureValueId)
DOMXMLSignature from the specified components.si - the SignedInfoki - the KeyInfo, or null if not specifiedobjs - a list of XMLObjects or null
if not specified. The list is copied to protect against subsequent
modification.id - an optional id (specify null to omit)signatureValueId - an optional id (specify null to
omit)NullPointerException - if si is nullpublic DOMXMLSignature(Element sigElem, XMLCryptoContext context, Provider provider) throws MarshalException
DOMXMLSignature from XML.sigElem - Signature elementMarshalException - if XMLSignature cannot be unmarshalledpublic String getId()
XMLSignatureXMLSignature.getId in interface XMLSignaturenull if not specified)public KeyInfo getKeyInfo()
XMLSignatureXMLSignature.getKeyInfo in interface XMLSignaturenull if not specified)public SignedInfo getSignedInfo()
XMLSignatureXMLSignature.getSignedInfo in interface XMLSignaturenull)public List getObjects()
XMLSignaturegetObjects in interface XMLSignatureXMLObjects (may be empty
but never null)public XMLSignature.SignatureValue getSignatureValue()
XMLSignatureXMLSignature.getSignatureValue in interface XMLSignaturepublic KeySelectorResult getKeySelectorResult()
XMLSignatureKeySelector, if specified, after
this XMLSignature has been signed or validated.getKeySelectorResult in interface XMLSignaturenull if a key
selector has not been specified or this XMLSignature
has not been signed or validatedpublic void marshal(Node parent, String dsPrefix, DOMCryptoContext context) throws MarshalException
marshal in class DOMStructureMarshalExceptionpublic void marshal(Node parent, Node nextSibling, String dsPrefix, DOMCryptoContext context) throws MarshalException
MarshalExceptionpublic boolean validate(XMLValidateContext vc) throws XMLSignatureException
XMLSignatureXMLSignature using the
location information specified in the context.
This method only validates the signature the first time it is invoked. On subsequent invocations, it returns a cached result.
validate in interface XMLSignaturevc - the validating contexttrue if the signature passed core validation,
otherwise falseXMLSignatureException - if an unexpected error occurs during
validation that prevented the validation operation from completingpublic void sign(XMLSignContext signContext) throws MarshalException, XMLSignatureException
XMLSignatureXMLSignature.
If this method throws an exception, this XMLSignature and
the signContext parameter will be left in the state that
it was in prior to the invocation.
sign in interface XMLSignaturesignContext - the signing contextMarshalException - if an exception occurs while marshallingXMLSignatureException - if an unexpected exception occurs while
generating the signatureCopyright © 2000–2023 The Apache Software Foundation. All rights reserved.