public class XAdESSignatureImpl extends iaik.xml.crypto.dsig.XMLSignatureImpl implements XAdESSignature
iaik.xml.crypto.dsig.XMLSignatureImpl.SignatureValueImpl
iaik.xml.crypto.dom.DOMStructure.NodeWrapper
XMLSignature.SignatureValue
Modifier and Type | Field and Description |
---|---|
protected QualifyingPropertiesImpl |
qualifyingProperties_ |
calculatedSignatureValue_, id_, keyInfo_, keySelectorResult_, objects_, POST_SIGN_HOOK, POST_VERIFY_HOOK, PRE_SIGN_HOOK, PRE_VERIFY_HOOK, signatureValue_, signedInfo_, STATE_SIGNED, valid_, validated_
implMap_, state_, STATE_CREATED, STATE_MARSHALED, STATE_UNINITIALIZED, STATE_UNMARSHALED
XMLNS_1_2_2, XMLNS_1_3_2, XMLNS_1_4_1, XMLNS_no_version
XMLNS
Constructor and Description |
---|
XAdESSignatureImpl(DOMCryptoContext context,
Node node) |
XAdESSignatureImpl(iaik.xml.crypto.dsig.SignedInfoImpl signedInfo,
KeyInfo keyInfo,
List objects,
String id,
String signatureValueId) |
Modifier and Type | Method and Description |
---|---|
void |
appendArchiveTimeStamp(ArchiveTimeStamp timeStamp,
XMLExtendContext context)
Appends an
ArchiveTimeStamp to the
UnsignedSignatureProperties . |
void |
appendCounterSignature(CounterSignature counterSignature,
XMLExtendContext context)
Appends a counter signature to the
UnsignedSignatureProperties
. |
protected void |
appendQualifyingProperties(DOMCryptoContext context)
Appends a new QualifyingProperties element to the marshaled signature.
|
void |
appendRenewedDigests(RenewedDigests renewedDigests,
XMLExtendContext context)
Depending on whether the given
RenewedDigests contains the recomputed digest values the method appends the given RenewedDigests or recomputes the digest values and appends
the RenewedDigests to the given signature:
The recomputed digest values are contained in the
given RenewedDigests :The method appends the given RenewedDigests to the UnsignedSignatureProperties . |
void |
appendSignaturePolicyStore(SignaturePolicyStore signaturePolicyStore,
XMLExtendContext context)
Appends a
SignaturePolicyStore to the
UnsignedSignatureProperties . |
void |
appendSignatureTimeStamp(SignatureTimeStamp signatureTimeStamp,
XMLExtendContext context)
Appends a signature time-stamp to the
UnsignedSignatureProperties . |
void |
appendTimeStampValidationData(TimeStampValidationData timeStampValidationData,
XMLExtendContext context)
Appends a
TimeStampValidationData to the
UnsignedSignatureProperties . |
void |
appendUnsignedDataObjectProperty(UnsignedDataObjectProperty property,
XMLExtendContext context)
Appends an unsigned data object property to the
UnsignedDataObjectProperties . |
void |
appendValidationRefs(CompleteCertificateRefs completeCertificateRefs,
CompleteRevocationRefs completeRevocationRefs,
AttributeCertificateRefs attributeCertificateRefs,
AttributeRevocationRefs attributeRevocationRefs,
XMLExtendContext context)
Deprecated.
|
void |
appendValidationRefsTimeStamp(RefsOnlyTimeStamp timeStamp,
XMLExtendContext context)
Deprecated.
|
void |
appendValidationRefsTimeStamp(SigAndRefsTimeStamp timeStamp,
XMLExtendContext context)
Deprecated.
|
void |
appendValidationRefsTimeStampV2(RefsOnlyTimeStampV2 timeStamp,
XMLExtendContext context)
Appends a time stamp on the validation data references to the
UnsignedSignatureProperties . |
void |
appendValidationRefsTimeStampV2(SigAndRefsTimeStampV2 timeStamp,
XMLExtendContext context)
Appends a time stamp on the validation data references to the
UnsignedSignatureProperties . |
void |
appendValidationRefsV2(CompleteCertificateRefsV2 completeCertificateRefsV2,
CompleteRevocationRefs completeRevocationRefs,
AttributeCertificateRefsV2 attributeCertificateRefsV2,
AttributeRevocationRefs attributeRevocationRefs,
XMLExtendContext context)
Appends references to validation data to the
UnsignedSignatureProperties . |
void |
appendValidationValues(CertificateValues certificateValues,
RevocationValues revocationValues,
AttrAuthoritiesCertValues attrAuthoritiesCertValues,
AttributeRevocationValues attributeRevocationValues,
XMLExtendContext context)
Appends validation data values to the
UnsignedSignatureProperties . |
protected UnsignedSignaturePropertiesImpl |
ensureUnsignedSignatureProperties(DOMCryptoContext context)
Ensures that a
UnsignedSignatureProperties element is present
and returns it. |
protected QualifyingPropertiesImpl |
findQualifyingProperties()
Looks for QualifyingProperties inside the ds:Objects of this signature.
|
protected void |
generateCore(DOMCryptoContext context) |
QualifyingProperties |
getQualifyingProperties()
Returns the
QualifyingProperties if present in the signature. |
List |
getQualifyingPropertiesReferences()
Deprecated.
|
void |
unmarshal(DOMCryptoContext context) |
assureDefaults, calculateAndMarshalSignatureValue, getChildStructures, getId, getKeyInfo, getKeySelectorResult, getLocalName, getObjects, getSignatureValue, getSignedInfo, marshal, marshalAttributes, marshalIDAttribute, putChildStructure, selectKey, selectKeyAndGenerateSignature, selectKeyAndValidateSignature, sign, unmarshalAttributes, unmarshalStructures, validate, validateCore, validateSignatureValue
addBytesToElement, addBytesToElement, clearMarshalling, clearMarshalling, getBytesFromElement, getBytesFromElementStream, getChildStructureVersion, getHere, getImplClass, getInstance, getInstance, getNode, getParentStructure, getParentStructureOf, getQualifiedName, getQualifiedName, hasNSDeclAttrInScope, isFeatureSupported, isNSDeclInScope, marshalElement, newIDforLookUp, putImplClass, setBackToCompatibilityPrior1_14, setNode, setParentStructure, toString, unmarshalElement, unmarshalIDAttribute, wrapNode
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
sign, validate
getId, getKeyInfo, getKeySelectorResult, getObjects, getSignatureValue, getSignedInfo
isFeatureSupported
protected QualifyingPropertiesImpl qualifyingProperties_
public XAdESSignatureImpl(DOMCryptoContext context, Node node) throws MarshalException
MarshalException
protected QualifyingPropertiesImpl findQualifyingProperties()
null
if no
QualifyingProperties have been foundpublic QualifyingProperties getQualifyingProperties()
XAdESSignature
QualifyingProperties
if present in the signature.getQualifyingProperties
in interface XAdESSignature
QualifyingProperties
, or null
if not
present in the signatureXAdESSignature.getQualifyingProperties()
public void unmarshal(DOMCryptoContext context) throws MarshalException
unmarshal
in class iaik.xml.crypto.dsig.XMLSignatureImpl
MarshalException
DOMStructure.unmarshal(DOMCryptoContext)
protected void generateCore(DOMCryptoContext context) throws XMLSignatureException, MarshalException
generateCore
in class iaik.xml.crypto.dsig.XMLSignatureImpl
XMLSignatureException
MarshalException
XMLSignatureImpl.generateCore(DOMCryptoContext)
protected void appendQualifyingProperties(DOMCryptoContext context) throws MarshalException, XMLSignatureException
If the signature doesn't have an xsd:Id
-attribute a new random
xsd:Id
attribute is created to be referenced by the
target
attribute of the QualifyingProperties
.
context
- the marshal contextMarshalException
- if marshaling failsXMLSignatureException
- if an unexpected exception occurs during the appending of the
QualifiedPorperitesprotected UnsignedSignaturePropertiesImpl ensureUnsignedSignatureProperties(DOMCryptoContext context) throws MarshalException, XMLSignatureException
UnsignedSignatureProperties
element is present
and returns it.context
- the contextUnsignedSignatureProperties
elementMarshalException
- if marshaling failsXMLSignatureException
- if an unexpected exception occurs during the appending of the
QualifiedPorperitespublic void appendCounterSignature(CounterSignature counterSignature, XMLExtendContext context) throws MarshalException, XMLSignatureException
XAdESSignature
UnsignedSignatureProperties
.
If not present, the container elements QualifyingProperties
,
UnsignedProperties
and
UnsignedSignatureProperties
are created by this method. If the
QualifyingProperties
element is not present in the signature a
new ds:Object
is created and the
QualifyingProperties
element is appended as child element.
appendCounterSignature
in interface XAdESSignature
counterSignature
- the CounterSignature
to be appended to the
UnsignedSignatureProperties
. Must not be
null
.context
- the extension context. Must not be null
.MarshalException
- if an exception occurs while marshalingXMLSignatureException
- if an unexpected exception occurs while appending the propertyXAdESSignature.appendCounterSignature(CounterSignature,
XMLExtendContext)
public void appendSignatureTimeStamp(SignatureTimeStamp signatureTimeStamp, XMLExtendContext context) throws MarshalException, XMLSignatureException
XAdESSignature
UnsignedSignatureProperties
.
If not present, the container elements QualifyingProperties
,
UnsignedProperties
and
UnsignedSignatureProperties
are created by this method. If the
QualifyingProperties
element is not present in the signature a
new ds:Object
is created and the
QualifyingProperties
element is appended as child element.
appendSignatureTimeStamp
in interface XAdESSignature
signatureTimeStamp
- the SignatureTimeStamp
to be appended to the
UnsignedSignatureProperties
. Must not be
null
.context
- the extension and time-stamping context. Must not be
null
.MarshalException
- if an exception occurs while marshalingXMLSignatureException
- if an unexpected exception occurs while appending the propertyXAdESSignature.appendSignatureTimeStamp(SignatureTimeStamp,
XMLExtendContext)
public void appendValidationRefs(CompleteCertificateRefs completeCertificateRefs, CompleteRevocationRefs completeRevocationRefs, AttributeCertificateRefs attributeCertificateRefs, AttributeRevocationRefs attributeRevocationRefs, XMLExtendContext context) throws MarshalException, XMLSignatureException
XAdESSignature
UnsignedSignatureProperties
.
If not present, the container elements QualifyingProperties
,
UnsignedProperties
and
UnsignedSignatureProperties
are created by this method. If the
QualifyingProperties
element is not present in the signature a
new ds:Object
is created and the
QualifyingProperties
element is appended as child element.
Note, that at least one of the arguments
completeCertificateRefs
, completeRevocationRefs
,
attributeCertificateRefs
and
attributeRevocationRefs
must not be null
.
appendValidationRefs
in interface XAdESSignature
completeCertificateRefs
- the CompleteCertificateRefs
to be appended to the
UnsignedSignatureProperties
completeRevocationRefs
- the CompleteRevocationRefs
to be appended to the
UnsignedSignatureProperties
attributeCertificateRefs
- the AttributeCertificateRefs
to be appended to the
UnsignedSignatureProperties
attributeRevocationRefs
- the AttributeRevocationRefs
to be appended to the
UnsignedSignatureProperties
context
- the extension context. Must not be null
.MarshalException
- if an exception occurs while marshalingXMLSignatureException
- if an unexpected exception occurs while appending the propertyXAdESSignature.appendValidationRefs(CompleteCertificateRefs,
CompleteRevocationRefs, AttributeCertificateRefs,
AttributeRevocationRefs, XMLExtendContext)
public void appendValidationRefsV2(CompleteCertificateRefsV2 completeCertificateRefsV2, CompleteRevocationRefs completeRevocationRefs, AttributeCertificateRefsV2 attributeCertificateRefsV2, AttributeRevocationRefs attributeRevocationRefs, XMLExtendContext context) throws MarshalException, XMLSignatureException
XAdESSignature
UnsignedSignatureProperties
.
If not present, the container elements QualifyingProperties
,
UnsignedProperties
and
UnsignedSignatureProperties
are created by this method. If the
QualifyingProperties
element is not present in the signature a
new ds:Object
is created and the
QualifyingProperties
element is appended as child element.
Note, that at least one of the arguments
completeCertificateRefs
, completeRevocationRefs
,
attributeCertificateRefs
and
attributeRevocationRefs
must not be null
.
appendValidationRefsV2
in interface XAdESSignature
completeCertificateRefsV2
- the CompleteCertificateRefsV2
to be appended to the
UnsignedSignatureProperties
completeRevocationRefs
- the CompleteRevocationRefs
to be appended to the
UnsignedSignatureProperties
attributeCertificateRefsV2
- the AttributeCertificateRefsV2
to be appended to the
UnsignedSignatureProperties
attributeRevocationRefs
- the AttributeRevocationRefs
to be appended to the
UnsignedSignatureProperties
context
- the extension context. Must not be null
.MarshalException
- if an exception occurs while marshalingXMLSignatureException
- if an unexpected exception occurs while appending the propertyXAdESSignature.appendValidationRefsV2(
CompleteCertificateRefsV2, CompleteRevocationRefs, AttributeCertificateRefsV2, AttributeRevocationRefs, XMLExtendContext)
public void appendValidationRefsTimeStamp(SigAndRefsTimeStamp timeStamp, XMLExtendContext context) throws MarshalException, XMLSignatureException
XAdESSignature
UnsignedSignatureProperties
.
If not present, the container elements QualifyingProperties
,
UnsignedProperties
and
UnsignedSignatureProperties
are created by this method. If the
QualifyingProperties
element is not present in the signature a
new ds:Object
is created and the
QualifyingProperties
element is appended as child element.
appendValidationRefsTimeStamp
in interface XAdESSignature
timeStamp
- the SigAndRefsTimeStamp
to be appended to the
UnsignedSignatureProperties
context
- the extension and time-stamping contextMarshalException
- if an exception occurs while marshalingXMLSignatureException
- if an unexpected exception occurs while appending the propertyXAdESSignature.appendValidationRefsTimeStamp(SigAndRefsTimeStamp,
XMLExtendContext)
public void appendValidationRefsTimeStampV2(SigAndRefsTimeStampV2 timeStamp, XMLExtendContext context) throws MarshalException, XMLSignatureException
XAdESSignature
UnsignedSignatureProperties
.
If not present, the container elements QualifyingProperties
,
UnsignedProperties
and
UnsignedSignatureProperties
are created by this method. If the
QualifyingProperties
element is not present in the signature a
new ds:Object
is created and the
QualifyingProperties
element is appended as child element.
appendValidationRefsTimeStampV2
in interface XAdESSignature
timeStamp
- the SigAndRefsTimeStampV2
to be appended to the
UnsignedSignatureProperties
context
- the extension and time-stamping contextMarshalException
- if an exception occurs while marshalingXMLSignatureException
- if an unexpected exception occurs while appending the propertyXAdESSignature.appendValidationRefsTimeStampV2(SigAndRefsTimeStampV2,
XMLExtendContext)
public void appendValidationRefsTimeStamp(RefsOnlyTimeStamp timeStamp, XMLExtendContext context) throws MarshalException, XMLSignatureException
XAdESSignature
UnsignedSignatureProperties
.
If not present, the container elements QualifyingProperties
,
UnsignedProperties
and
UnsignedSignatureProperties
are created by this method. If the
QualifyingProperties
element is not present in the signature a
new ds:Object
is created and the
QualifyingProperties
element is appended as child element.
appendValidationRefsTimeStamp
in interface XAdESSignature
timeStamp
- the RefsOnlyTimeStamp
to be appended to the
UnsignedSignatureProperties
context
- the extension and time-stamping contextMarshalException
- if an exception occurs while marshalingXMLSignatureException
- if an unexpected exception occurs while appending the propertyXAdESSignature.appendValidationRefsTimeStamp(RefsOnlyTimeStamp,
XMLExtendContext)
public void appendValidationRefsTimeStampV2(RefsOnlyTimeStampV2 timeStamp, XMLExtendContext context) throws MarshalException, XMLSignatureException
XAdESSignature
UnsignedSignatureProperties
.
If not present, the container elements QualifyingProperties
,
UnsignedProperties
and
UnsignedSignatureProperties
are created by this method. If the
QualifyingProperties
element is not present in the signature a
new ds:Object
is created and the
QualifyingProperties
element is appended as child element.
appendValidationRefsTimeStampV2
in interface XAdESSignature
timeStamp
- the RefsOnlyTimeStampV2
to be appended to the
UnsignedSignatureProperties
context
- the extension and time-stamping contextMarshalException
- if an exception occurs while marshalingXMLSignatureException
- if an unexpected exception occurs while appending the propertyXAdESSignature.appendValidationRefsTimeStampV2(RefsOnlyTimeStampV2,
XMLExtendContext)
public void appendValidationValues(CertificateValues certificateValues, RevocationValues revocationValues, AttrAuthoritiesCertValues attrAuthoritiesCertValues, AttributeRevocationValues attributeRevocationValues, XMLExtendContext context) throws MarshalException, XMLSignatureException
XAdESSignature
UnsignedSignatureProperties
.
If not present, the container elements QualifyingProperties
,
UnsignedProperties
and
UnsignedSignatureProperties
are created by this method. If the
QualifyingProperties
element is not present in the signature a
new ds:Object
is created and the
QualifyingProperties
element is appended as child element.
Note, that at least one of the arguments certificateValues
,
revocationValues
, attrAuthoritiesCertValues
and
attributeRevocartionValues
must not be null
.
appendValidationValues
in interface XAdESSignature
certificateValues
- the CertificateValues
to be appended to the
UnsignedSignatureProperties
revocationValues
- the RevocationValues
to be appended to the
UnsignedSignatureProperties
attrAuthoritiesCertValues
- the AttrAuthoritiesCertValues
to be appended to the
UnsignedSignatureProperties
attributeRevocationValues
- the AttributeRevocationValues
to be appended to the
UnsignedSignatureProperties
context
- the extension context. Must not be null
.MarshalException
- if an exception occurs while marshalingXMLSignatureException
- if an unexpected exception occurs while appending the propertyXAdESSignature.appendValidationValues(CertificateValues,
RevocationValues, AttrAuthoritiesCertValues,
AttributeRevocationValues, XMLExtendContext)
public void appendArchiveTimeStamp(ArchiveTimeStamp timeStamp, XMLExtendContext context) throws MarshalException, XMLSignatureException
XAdESSignature
ArchiveTimeStamp
to the
UnsignedSignatureProperties
.
If not present, the container elements QualifyingProperties
,
UnsignedProperties
and
UnsignedSignatureProperties
are created by this method. If the
QualifyingProperties
element is not present in the signature a
new ds:Object
is created and the
QualifyingProperties
element is appended as child element.
appendArchiveTimeStamp
in interface XAdESSignature
timeStamp
- the ArchiveTimeStamp
to be appended to the
UnsignedSignatureProperties
. Must not be
null
.MarshalException
XMLSignatureException
XAdESSignature.appendArchiveTimeStamp(ArchiveTimeStamp,
XMLExtendContext)
public void appendTimeStampValidationData(TimeStampValidationData timeStampValidationData, XMLExtendContext context) throws MarshalException, XMLSignatureException
XAdESSignature
TimeStampValidationData
to the
UnsignedSignatureProperties
.
If not present, the container elements QualifyingProperties
,
UnsignedProperties
and
UnsignedSignatureProperties
are created by this method. If the
QualifyingProperties
element is not present in the signature a
new ds:Object
is created and the
QualifyingProperties
element is appended as child element.
appendTimeStampValidationData
in interface XAdESSignature
timeStampValidationData
- the TimeValidationData
to be appended to the
UnsignedSignatureProperties
. Must not be
null
.MarshalException
XMLSignatureException
XAdESSignature.appendTimeStampValidationData(TimeStampValidationData, XMLExtendContext)
public void appendSignaturePolicyStore(SignaturePolicyStore signaturePolicyStore, XMLExtendContext context) throws MarshalException, XMLSignatureException
XAdESSignature
SignaturePolicyStore
to the
UnsignedSignatureProperties
.
If not present, the container elements QualifyingProperties
,
UnsignedProperties
and
UnsignedSignatureProperties
are created by this method. If the
QualifyingProperties
element is not present in the signature a
new ds:Object
is created and the
QualifyingProperties
element is appended as child element.
appendSignaturePolicyStore
in interface XAdESSignature
signaturePolicyStore
- the SignaturePolicyStore
to be appended to the
UnsignedSignatureProperties
. Must not be
null
.context
- the extension context. Must not be
null
.MarshalException
- if an exception occurs while marshalingXMLSignatureException
- if an unexpected exception occurs while appending the propertyXAdESSignature.appendSignaturePolicyStore(SignaturePolicyStore, XMLExtendContext)
public void appendRenewedDigests(RenewedDigests renewedDigests, XMLExtendContext context) throws MarshalException, XMLSignatureException
XAdESSignature
RenewedDigests
contains the recomputed digest values
the method appends the given RenewedDigests
or recomputes the digest values and appends
the RenewedDigests
to the given signature:
recomputed digest values
are contained in the
given RenewedDigests
:RenewedDigests
to the UnsignedSignatureProperties
.
recomputed digest values
are
not contained in the given RenewedDigests
:digest method
and appends the RenewedDigests
to the UnsignedSignatureProperties
.
If not present, the container elements QualifyingProperties
,
UnsignedProperties
and
UnsignedSignatureProperties
are created by this method. If the
QualifyingProperties
element is not present in the signature a
new ds:Object
is created and the
QualifyingProperties
element is appended as child element.
appendRenewedDigests
in interface XAdESSignature
renewedDigests
- the RenewedDigests
to be appended to the
UnsignedSignatureProperties
. Must not be
null
.context
- the extension context. Must not be
null
.MarshalException
- if an exception occurs while marshalingXMLSignatureException
- if an unexpected exception occurs while appending the propertyXAdESSignature.appendRenewedDigests(RenewedDigests, XMLExtendContext)
public void appendUnsignedDataObjectProperty(UnsignedDataObjectProperty property, XMLExtendContext context) throws MarshalException, XMLSignatureException
XAdESSignature
UnsignedDataObjectProperties
.
If not present, the container elements QualifyingProperties
,
UnsignedProperties
and
UnsignedDataObjectProperties
are created by this method. If
the QualifyingProperties
element is not present in the
signature a new ds:Object
is created and the
QualifyingProperties
element is appended as child element.
appendUnsignedDataObjectProperty
in interface XAdESSignature
property
- the UnsignedDataObjectProperty
to append to the
UnsignedDataObjectProperties
. Must not be
null
.context
- the extension and time-stamping context. Must not be
null
.MarshalException
- if an exception occurs while marshalingXMLSignatureException
- if an unexpected exception occurs while appending the propertyXAdESSignature.appendUnsignedDataObjectProperty(UnsignedDataObjectProperty,
XMLExtendContext)
public List getQualifyingPropertiesReferences()
getQualifyingPropertiesReferences
in interface XAdESSignature
QualifyingPropertiesReference
s© 2002-2005 IAIK, © 2004, 2006 - 2017 Stiftung SIC