java.lang.Object
eu.europa.esig.dss.spi.signature.DefaultAdvancedSignature
eu.europa.esig.dss.xades.validation.XAdESSignature
- All Implemented Interfaces:
eu.europa.esig.dss.model.identifier.IdentifierBasedObject,eu.europa.esig.dss.spi.signature.AdvancedSignature,Serializable
public class XAdESSignature
extends eu.europa.esig.dss.spi.signature.DefaultAdvancedSignature
Parse an XAdES signature structure. Note that for each signature to be validated a new instance of this object must
be created.
- See Also:
-
Field Summary
Fields inherited from class eu.europa.esig.dss.spi.signature.DefaultAdvancedSignature
counterSignatures, detachedContents, manifestFile, offlineCertificateSource, referenceValidations, signatureCRLSource, signatureCryptographicVerification, signatureIdentifier, signatureOCSPSource, signaturePolicy, signatureTimestampSource, signingCertificateSource, structureValidationMessages -
Constructor Summary
ConstructorsConstructorDescriptionXAdESSignature(Element signatureElement) This constructor is used when creating the signature.XAdESSignature(Element signatureElement, List<XAdESPath> xadesPathHolders) The default constructor for XAdESSignature. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExternalTimestamp(eu.europa.esig.dss.spi.x509.tsp.TimestampToken timestamp) protected XAdESSignaturePolicyvoidprotected XAdESBaselineRequirementsCheckercreateBaselineRequirementsChecker(eu.europa.esig.dss.spi.validation.CertificateVerifier certificateVerifier) protected List<eu.europa.esig.dss.model.scope.SignatureScope> protected XAdESBaselineRequirementsCheckereu.europa.esig.dss.spi.SignatureCertificateSourceDeprecated.since DSS 6.2.List<eu.europa.esig.dss.model.signature.SignerRole> List<eu.europa.esig.dss.model.signature.SignerRole> List<eu.europa.esig.dss.model.signature.CommitmentTypeIndication> Deprecated.since DSS 6.2.Deprecated.since DSS 6.2.List<eu.europa.esig.dss.spi.signature.AdvancedSignature> This method retrieves the potential countersignatures embedded in the XAdES signature document.eu.europa.esig.dss.spi.x509.revocation.crl.OfflineCRLSourceeu.europa.esig.dss.enumerations.SignatureLeveleu.europa.esig.dss.model.Digesteu.europa.esig.dss.enumerations.DigestAlgorithmeu.europa.esig.dss.enumerations.EncryptionAlgorithmDeprecated.since DSS 6.2.Gets ds:Manifest by its IdgetObjectById(String id) Gets ds:Object by its IdThis method returns the list of ds:Object elements for the current signature element.eu.europa.esig.dss.spi.x509.revocation.ocsp.OfflineOCSPSourceList<org.apache.xml.security.signature.Reference> Gets a list of found referencesList<eu.europa.esig.dss.model.ReferenceValidation> Deprecated.since DSS 6.2.Deprecated.since DSS 6.2.Deprecated.since DSS 6.2.eu.europa.esig.dss.enumerations.SignatureAlgorithmeu.europa.esig.dss.model.signature.SignatureDigestReferencegetSignatureDigestReference(eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm) TS 119 442 - V1.1.1 - Electronic Signatures and Infrastructures (ESI), ch. 5.1.4.2.1.3 XML component: In case of XAdES signatures, the input of the digest value computation shall be the result of applying the canonicalization algorithm identified within the CanonicalizationMethod child element's value to the corresponding ds:Signature element and its contents.Returns the w3c.dom encapsulated signature element.eu.europa.esig.dss.enumerations.SignatureFormprotected eu.europa.esig.dss.spi.signature.identifier.SignatureIdentifierBuilderGets a list of found signature ds:Object elementseu.europa.esig.dss.model.SignaturePolicyStoreeu.europa.esig.dss.model.signature.SignatureProductionPlacebyte[]Returns a base64 SignatureValueReturns Id of the ds:SignatureValue elementList<eu.europa.esig.dss.model.signature.SignerRole> Retrieves the name of each node found under the SignedDataObjectProperties elementReturns the ds:SignedInfo elementRetrieves the name of each node found under the SignedProperties elementRetrieves the name of each node found under the SignedSignatureProperties elementRetrieves the name of each node found under the UnsignedProperties elementRetrieves the name of each node found under the UnsignedSignatureProperties elementeu.europa.esig.dss.xml.common.definition.DSSNamespaceReturns the XAdES namespaceGets the currentXAdESPathsReturns a list of usedXAdESPathseu.europa.esig.dss.xml.common.definition.DSSNamespaceReturns the XMLDSIG namespacevoidrecursiveNamespaceBrowser(Element element) This method sets the namespace which will determinate theXAdESPathsto use.voidregisterXAdESPaths(XAdESPath xadesPaths) This method allows to register a newXAdESPaths.voidsetDisableXSWProtection(boolean disableXSWProtection) NOT RECOMMENDED : This parameter allows to disable protection against XML Signature wrapping attacks (XSW).Methods inherited from class eu.europa.esig.dss.spi.signature.DefaultAdvancedSignature
addExternalEvidenceRecord, areAllSelfSignedCertificates, equals, getAllEvidenceRecords, getAllTimestamps, getArchiveTimestamps, getCandidatesForSigningCertificate, getCertificates, getCompleteCertificateSource, getCompleteCRLSource, getCompleteOCSPSource, getContainerContents, getContentTimestamps, getCounterSignaturesCertificateSource, getCounterSignaturesCRLSource, getCounterSignaturesOCSPSource, getDetachedContents, getDetachedEvidenceRecords, getDetachedTimestamps, getDocumentTimestamps, getDSSId, getEmbeddedEvidenceRecords, getFilename, getId, getManifestFile, getMasterSignature, getSignatureCryptographicVerification, getSignatureFilename, getSignatureScopes, getSignatureTimestamps, getSignerRoles, getSigningCertificateToken, getStructureValidationResult, getTimestampsX1, getTimestampsX2, hasAProfile, hasBESProfile, hasBProfile, hasCProfile, hasEPESProfile, hasExtendedTProfile, hashCode, hasLTAProfile, hasLTProfile, hasTProfile, hasXLProfile, hasXProfile, initBaselineRequirementsChecker, isCounterSignature, isDocHashOnlyValidation, isHashOnlyValidation, resetCertificateSource, resetRevocationSources, resetTimestampSource, setContainerContents, setDetachedContents, setFilename, setManifestFile, setMasterSignature, setSignatureFilename, setSigningCertificateSource, toString
-
Constructor Details
-
XAdESSignature
This constructor is used when creating the signature. The defaultXPathQueryHolderis set.- Parameters:
signatureElement- the signature DOM element
-
XAdESSignature
-
-
Method Details
-
setDisableXSWProtection
public void setDisableXSWProtection(boolean disableXSWProtection) NOT RECOMMENDED : This parameter allows to disable protection against XML Signature wrapping attacks (XSW). It disables the research by XPath expression for defined Type attributes.- Parameters:
disableXSWProtection- true to disable the protection
-
recursiveNamespaceBrowser
-
getXAdESPathsHolders
-
getXAdESPaths
-
getXmldSigNamespace
public eu.europa.esig.dss.xml.common.definition.DSSNamespace getXmldSigNamespace()Returns the XMLDSIG namespace- Returns:
DSSNamespace
-
getXadesNamespace
public eu.europa.esig.dss.xml.common.definition.DSSNamespace getXadesNamespace()Returns the XAdES namespace- Returns:
DSSNamespace
-
getSignatureElement
Returns the w3c.dom encapsulated signature element.- Returns:
- the signatureElement
-
getSignatureForm
public eu.europa.esig.dss.enumerations.SignatureForm getSignatureForm() -
getEncryptionAlgorithm
public eu.europa.esig.dss.enumerations.EncryptionAlgorithm getEncryptionAlgorithm() -
getDigestAlgorithm
public eu.europa.esig.dss.enumerations.DigestAlgorithm getDigestAlgorithm() -
getSignatureAlgorithm
public eu.europa.esig.dss.enumerations.SignatureAlgorithm getSignatureAlgorithm() -
getCertificateSource
public eu.europa.esig.dss.spi.SignatureCertificateSource getCertificateSource() -
getCRLSource
public eu.europa.esig.dss.spi.x509.revocation.crl.OfflineCRLSource getCRLSource() -
getOCSPSource
public eu.europa.esig.dss.spi.x509.revocation.ocsp.OfflineOCSPSource getOCSPSource() -
getTimestampSource
-
getSigningTime
-
getSignaturePolicy
- Specified by:
getSignaturePolicyin interfaceeu.europa.esig.dss.spi.signature.AdvancedSignature- Overrides:
getSignaturePolicyin classeu.europa.esig.dss.spi.signature.DefaultAdvancedSignature
-
buildSignaturePolicy
- Specified by:
buildSignaturePolicyin classeu.europa.esig.dss.spi.signature.DefaultAdvancedSignature
-
getSignatureProductionPlace
public eu.europa.esig.dss.model.signature.SignatureProductionPlace getSignatureProductionPlace() -
getSignaturePolicyStore
public eu.europa.esig.dss.model.SignaturePolicyStore getSignaturePolicyStore() -
getSignedAssertions
-
getClaimedSignerRoles
-
getCertifiedSignerRoles
-
getContentType
-
getMimeType
-
getSignatureValueBase64
-
getSignatureValue
public byte[] getSignatureValue() -
getSignatureValueId
-
getObjects
-
getCompleteCertificateRefs
Deprecated.since DSS 6.2. To be removed.Gets xades:CompleteCertificateRefs or xades141:CompleteCertificateRefsV2 element- Returns:
Element
-
getCompleteRevocationRefs
-
getSigAndRefsTimeStamp
Deprecated.since DSS 6.2. To be removed.Gets xades:SigAndRefsTimeStamp node list- Returns:
NodeList
-
getRefsOnlyTimestampTimeStamp
-
getCertificateValues
-
getRevocationValues
-
addExternalTimestamp
public void addExternalTimestamp(eu.europa.esig.dss.spi.x509.tsp.TimestampToken timestamp) -
getBaselineRequirementsChecker
- Overrides:
getBaselineRequirementsCheckerin classeu.europa.esig.dss.spi.signature.DefaultAdvancedSignature
-
createBaselineRequirementsChecker
protected XAdESBaselineRequirementsChecker createBaselineRequirementsChecker(eu.europa.esig.dss.spi.validation.CertificateVerifier certificateVerifier) - Specified by:
createBaselineRequirementsCheckerin classeu.europa.esig.dss.spi.signature.DefaultAdvancedSignature
-
checkSignatureIntegrity
public void checkSignatureIntegrity() -
getReferenceValidations
-
getSignatureDigestReference
public eu.europa.esig.dss.model.signature.SignatureDigestReference getSignatureDigestReference(eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm) TS 119 442 - V1.1.1 - Electronic Signatures and Infrastructures (ESI), ch. 5.1.4.2.1.3 XML component: In case of XAdES signatures, the input of the digest value computation shall be the result of applying the canonicalization algorithm identified within the CanonicalizationMethod child element's value to the corresponding ds:Signature element and its contents. The canonicalization shall be computed keeping this ds:Signature element as a descendant of the XML root element, without detaching it. -
getDataToBeSignedRepresentation
public eu.europa.esig.dss.model.Digest getDataToBeSignedRepresentation() -
getSignedInfo
-
getObjectById
-
getManifestById
-
getCounterSignatures
This method retrieves the potential countersignatures embedded in the XAdES signature document. From ETSI TS 101 903 v1.4.2: 7.2.4.1 Countersignature identifier in Type attribute of ds:Reference A XAdES signature containing a ds:Reference element whose Type attribute has value "http://uri.etsi.org/01903#CountersignedSignature" will indicate that is is, in fact, a countersignature of the signature referenced by this element. 7.2.4.2 Enveloped countersignatures: the CounterSignature element The CounterSignature is an unsigned property that qualifies the signature. A XAdES signature MAY have more than one CounterSignature properties. As indicated by its name, it contains one countersignature of the qualified signature.- Returns:
- a list containing the countersignatures embedded in the XAdES signature document
-
getSignatureIdentifierBuilder
protected eu.europa.esig.dss.spi.signature.identifier.SignatureIdentifierBuilder getSignatureIdentifierBuilder()- Specified by:
getSignatureIdentifierBuilderin classeu.europa.esig.dss.spi.signature.DefaultAdvancedSignature
-
getDAIdentifier
-
getUnsignedSignatureProperties
-
getSignedSignatureProperties
-
getSignedProperties
-
getUnsignedProperties
-
getSignedDataObjectProperties
-
getDataFoundUpToLevel
public eu.europa.esig.dss.enumerations.SignatureLevel getDataFoundUpToLevel() -
validateStructure
-
findSignatureScopes
- Specified by:
findSignatureScopesin classeu.europa.esig.dss.spi.signature.DefaultAdvancedSignature
-
getLastTimestampValidationData
Deprecated.since DSS 6.2. To be removed.This method returns the last timestamp validation data for an archive timestamp.- Returns:
Elementxades141:TimestampValidationData
-
getCommitmentTypeIndications
public List<eu.europa.esig.dss.model.signature.CommitmentTypeIndication> getCommitmentTypeIndications() -
getReferences
Gets a list of found references- Returns:
- a list of
References
-
getSignatureObjects
-
registerXAdESPaths
This method allows to register a newXAdESPaths.- Parameters:
xadesPaths-XAdESPathsto register
-