public interface SignaturePolicyId extends XMLStructure
SignaturePolicyId
element as defined in
ETSI TS 101 933 v1.3.2.
<xsd:complexType name="SignaturePolicyIdType"> <xsd:sequence> <xsd:element name="SigPolicyId" type="ObjectIdentifierType"/> <xsd:element ref="ds:Transforms" minOccurs="0"/> <xsd:element name="SigPolicyHash" type="DigestAlgAndValueType"/> <xsd:element name="SigPolicyQualifiers" type="SigPolicyQualifiersListType" minOccurs="0"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="SigPolicyQualifiersListType"> <xsd:sequence> <xsd:element name="SigPolicyQualifier" type="AnyType" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType>
SignaturePolicyId
element may be created by invoking one of
the
newSignaturePolicyId
methods of the
QualifyingPropertiesFactory
class; for example:
XMLSignatureFactory sfac = XMLSignatureFactory.getInstance("DOM"); QualifyingPropertiesFactory qfac = QualifyingPropertiesFactory.getInstance("DOM"); ObjectIdentifier objId = qfac.newObjectIdentifier("http://foo.org/SigPolicy/v1.2", null, "Foo Org. Signature Policy", null); SPURI spuri = qfac.newSPURI("http://foo.org/SigPolicy/v1.2.xml"); SigPolicyQualifier spq = qfac.newSigPolicyQualifier(Collections.singletonList(spuri)); SignaturePolicyId spid = qfac.newSignaturePolicyId(objId, null, sfac.newDigestMethod(DigestMethod.SHA1, null), null, Collections.singletonList(spq));
Modifier and Type | Method and Description |
---|---|
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()
|
boolean |
validate(XMLCryptoContext context,
Data digestInput)
Validates the digest value.
|
isFeatureSupported
ObjectIdentifier getSigPolicyId()
SigPolicyId
.SigPolicyId
List getTransforms()
Transform
s
(may be empty but never null
)DigestAlgAndValue getSigPolicyHash()
SigPolicyHash
.SigPolicyHash
List getSignaturePolicyQualifiers()
unmodifiable list
of SignaturePolicyQualifer
s that are
contained in this SignaturePolicyId
.SigPolicyQualifier
s (may be empty
but never null
)boolean validate(XMLCryptoContext context, Data digestInput) throws XMLSignatureException
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.
context
- the validation contextdigestInput
- the input for the digest computationtrue
if the digest value validated successfully;
false
otherwiseNullPointerException
- if context
is null
XMLSignatureException
- if an unexpected exception occurs while validating the digest valueReference.validate(XMLValidateContext)
© 2002-2005 IAIK, © 2004, 2006 - 2017 Stiftung SIC