public class SignaturePolicyIdImpl extends XadesDOMStructure implements SignaturePolicyId
SignaturePolicyId
element that supports
the DOM XML processing and representation mechanism.Constructor and Description |
---|
SignaturePolicyIdImpl(DOMCryptoContext context,
Node node)
Creates a new instance of this
SignaturePolicyIdImpl with
the given marshal context and node. |
SignaturePolicyIdImpl(ObjectIdentifierImpl sigPolicyId,
List transforms,
iaik.xml.crypto.dsig.DigestMethodImpl digestMethod,
Data digestInput,
List sigPolicyQualifiers)
Creates a new instance of this
SignaturePolicyIdImpl with
the given SigPolicyId , list of
Transform s, digest method, input for the
digest computation and list of SigPolicyQualifier s. |
SignaturePolicyIdImpl(ObjectIdentifierImpl sigPolicyId,
List transforms,
SigPolicyHashImpl sigPolicyHash,
List sigPolicyQualifiers)
Creates a new instance of this
SignaturePolicyIdImpl with
the given SigPolicyId , list of
Transform s, SigPolicyHash and
list of SigPolicyQualifier s. |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkTransforms(List transforms)
Checks if the list of given transforms contains the
SPDocDigestAsInSpecification transform. |
protected Data |
dereferenceSPURIs(XMLCryptoContext context)
Dereferences any
SPURI s present in the SigPolicyQualifier
s and returns the data form the first successfully dereferenced
SPURI . |
protected List |
getChildStructures() |
String |
getLocalName() |
List |
getSignaturePolicyQualifiers()
Returns an
unmodifiable list of SignaturePolicyQualifer s that are
contained in this SignaturePolicyId . |
DigestAlgAndValue |
getSigPolicyHash()
Returns the
SigPolicyHash . |
ObjectIdentifier |
getSigPolicyId()
Returns the
SigPolicyId . |
List |
getTransforms()
|
Node |
marshal(DOMCryptoContext context,
Node parent,
Node nextSibling) |
protected void |
putChildStructure(iaik.xml.crypto.dom.DOMStructure childStructure) |
boolean |
validate(XMLCryptoContext context,
Data digestInput)
Validates the digest value.
|
getInstance, getNamespace, getParentQualifyingPropertiesOf, getParentSignatureOf
addBytesToElement, addBytesToElement, clearMarshalling, clearMarshalling, getBytesFromElement, getBytesFromElementStream, getChildStructureVersion, getHere, getImplClass, getInstance, getInstance, getNode, getParentStructure, getParentStructureOf, getQualifiedName, getQualifiedName, hasNSDeclAttrInScope, isFeatureSupported, isNSDeclInScope, marshalAttributes, marshalElement, marshalIDAttribute, newIDforLookUp, putImplClass, setBackToCompatibilityPrior1_14, setNode, setParentStructure, toString, unmarshal, unmarshalAttributes, unmarshalElement, unmarshalIDAttribute, unmarshalStructures, wrapNode
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isFeatureSupported
public SignaturePolicyIdImpl(DOMCryptoContext context, Node node) throws MarshalException
SignaturePolicyIdImpl
with
the given marshal context and node.context
- the contextnode
- the node to unmarshal fromMarshalException
- if unmarshaling from the specified node failspublic SignaturePolicyIdImpl(ObjectIdentifierImpl sigPolicyId, List transforms, SigPolicyHashImpl sigPolicyHash, List sigPolicyQualifiers)
SignaturePolicyIdImpl
with
the given SigPolicyId
, list of
Transform
s, SigPolicyHash
and
list of SigPolicyQualifier
s.sigPolicyId
- the SigPolicyId
transforms
- a list of Transform
s (may be
null
or empty)sigPolicyHash
- the SigPolicyHash
sigPolicyQualifiers
- a list of SigPolicyQualifier
s (may be
null
or empty)NullPointerException
- if sigPolicyId
or sigPolicyHash
is
null
ClassCastException
- if any of the transforms is not of type
Transform
, or if any of the
sigPolicyQualifiers is not of type SigPolicyQualifier
public SignaturePolicyIdImpl(ObjectIdentifierImpl sigPolicyId, List transforms, iaik.xml.crypto.dsig.DigestMethodImpl digestMethod, Data digestInput, List sigPolicyQualifiers)
SignaturePolicyIdImpl
with
the given SigPolicyId
, list of
Transform
s, digest method, input for the
digest computation and list of SigPolicyQualifier
s.sigPolicyId
- the SigPolicyId
transforms
- a list of Transform
s (may be
null
or empty)digestMethod
- the digest methoddigestInput
- the input for the digest computationsigPolicyQualifiers
- a list of SigPolicyQualifier
s (may be
null
or empty)NullPointerException
- if sigPolicyId
or sigPolicyHash
is
null
ClassCastException
- if any of the transforms is not of type
Transform
, or if any of the
sigPolicyQualifiers is not of type SigPolicyQualifier
public ObjectIdentifier getSigPolicyId()
SignaturePolicyId
SigPolicyId
.getSigPolicyId
in interface SignaturePolicyId
SigPolicyId
SignaturePolicyId.getSigPolicyId()
public List getTransforms()
SignaturePolicyId
getTransforms
in interface SignaturePolicyId
Transform
s
(may be empty but never null
)SignaturePolicyId.getTransforms()
public DigestAlgAndValue getSigPolicyHash()
SignaturePolicyId
SigPolicyHash
.getSigPolicyHash
in interface SignaturePolicyId
SigPolicyHash
SignaturePolicyId.getSigPolicyHash()
public List getSignaturePolicyQualifiers()
SignaturePolicyId
unmodifiable list
of SignaturePolicyQualifer
s that are
contained in this SignaturePolicyId
.getSignaturePolicyQualifiers
in interface SignaturePolicyId
SigPolicyQualifier
s (may be empty
but never null
)SignaturePolicyId.getSignaturePolicyQualifiers()
public String getLocalName()
getLocalName
in class iaik.xml.crypto.dom.DOMStructure
DOMStructure.getLocalName()
protected List getChildStructures()
getChildStructures
in class iaik.xml.crypto.dom.DOMStructure
DOMStructure.getChildStructures()
protected void putChildStructure(iaik.xml.crypto.dom.DOMStructure childStructure) throws MarshalException
putChildStructure
in class iaik.xml.crypto.dom.DOMStructure
MarshalException
DOMStructure.putChildStructure(DOMStructure)
public Node marshal(DOMCryptoContext context, Node parent, Node nextSibling) throws MarshalException
marshal
in class iaik.xml.crypto.dom.DOMStructure
MarshalException
DOMStructure.marshal(DOMCryptoContext, Node,
Node)
protected Data dereferenceSPURIs(XMLCryptoContext context) throws XMLSignatureException
SPURI
s present in the SigPolicyQualifier
s and returns the data form the first successfully dereferenced
SPURI
.context
- the contextSPURI
,
or null
if no SPURI
is present or could
be dereferenced successfullyXMLSignatureException
- if an unexpected exception occurred during the dereferencing
of the SPURI
spublic boolean validate(XMLCryptoContext context, Data digestInput) throws XMLSignatureException
SignaturePolicyId
The input for the digest computation is obtained from the given
digestInput
if present, or alternatively from the first
SPURI
within the qualifiers that could be dereferenced
successfully. The digest is computed using the digest input as obtained
above and applying all present transforms according to the reference
processing model of XML-Signature
Syntax and Processing. If no digest input is given and no SPURI
is present or could be dereferenced a XMLSignatureException
is
thrown.
If no digestInput
is given the method only validates the
reference the first time it is invoked. On subsequent invocations, it
returns a cached result unless a digestinput is provided.
validate
in interface SignaturePolicyId
context
- the validation contextdigestInput
- the input for the digest computationtrue
if the digest value validated successfully;
false
otherwiseXMLSignatureException
- if an unexpected exception occurs while validating the digest valueSignaturePolicyId.validate(javax.xml.crypto.XMLCryptoContext,
javax.xml.crypto.Data)
protected boolean checkTransforms(List transforms)
SPDocDigestAsInSpecification
transform.transforms
- A list of transforms
.True
if the given list of transforms contains the
SPDocDigestAsInSpecification
, otherwise false
.© 2002-2005 IAIK, © 2004, 2006 - 2017 Stiftung SIC