public final class DOMXMLSignature extends DOMStructure implements XMLSignature
Modifier and Type | Class and Description |
---|---|
class |
DOMXMLSignature.DOMSignatureValue |
XMLSignature.SignatureValue
XMLNS
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.
|
isFeatureSupported
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
isFeatureSupported
public DOMXMLSignature(SignedInfo si, KeyInfo ki, List<? extends XMLObject> objs, String id, String signatureValueId)
DOMXMLSignature
from the specified components.si
- the SignedInfo
ki
- the KeyInfo
, or null
if not specifiedobjs
- a list of XMLObject
s 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 null
public DOMXMLSignature(Element sigElem, XMLCryptoContext context, Provider provider) throws MarshalException
DOMXMLSignature
from XML.sigElem
- Signature elementMarshalException
- if XMLSignature cannot be unmarshalledpublic String getId()
XMLSignature
XMLSignature
.getId
in interface XMLSignature
null
if not specified)public KeyInfo getKeyInfo()
XMLSignature
XMLSignature
.getKeyInfo
in interface XMLSignature
null
if not specified)public SignedInfo getSignedInfo()
XMLSignature
XMLSignature
.getSignedInfo
in interface XMLSignature
null
)public List getObjects()
XMLSignature
getObjects
in interface XMLSignature
XMLObject
s (may be empty
but never null
)public XMLSignature.SignatureValue getSignatureValue()
XMLSignature
XMLSignature
.getSignatureValue
in interface XMLSignature
public KeySelectorResult getKeySelectorResult()
XMLSignature
KeySelector
, if specified, after
this XMLSignature
has been signed or validated.getKeySelectorResult
in interface XMLSignature
null
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 DOMStructure
MarshalException
public void marshal(Node parent, Node nextSibling, String dsPrefix, DOMCryptoContext context) throws MarshalException
MarshalException
public boolean validate(XMLValidateContext vc) throws XMLSignatureException
XMLSignature
XMLSignature
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 XMLSignature
vc
- the validating contexttrue
if the signature passed core validation,
otherwise false
XMLSignatureException
- if an unexpected error occurs during
validation that prevented the validation operation from completingpublic void sign(XMLSignContext signContext) throws MarshalException, XMLSignatureException
XMLSignature
XMLSignature
.
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 XMLSignature
signContext
- the signing contextMarshalException
- if an exception occurs while marshallingXMLSignatureException
- if an unexpected exception occurs while
generating the signatureCopyright © 2000–2017 The Apache Software Foundation. All rights reserved.