Class XMLDocumentValidator
java.lang.Object
eu.europa.esig.dss.validation.SignedDocumentValidator
eu.europa.esig.dss.xades.validation.XMLDocumentValidator
- All Implemented Interfaces:
DocumentValidator,ProcessExecutorProvider<DocumentProcessExecutor>
public class XMLDocumentValidator extends SignedDocumentValidator
Validator of XML Signed document
-
Field Summary
Fields Modifier and Type Field Description protected DocumentrootElementThe root element of the document to validateprotected List<XAdESPaths>xadesPathsHoldersThis variable contains the list ofXAdESPathsadapted to the specific signature schema.Fields inherited from class eu.europa.esig.dss.validation.SignedDocumentValidator
certificateVerifier, containerContents, detachedContents, document, manifestFile, processExecutor, signatureScopeFinder, signingCertificateSource, skipValidationContextExecution -
Constructor Summary
Constructors Constructor Description XMLDocumentValidator(DSSDocument dssDocument)The default constructor for XMLDocumentValidator. -
Method Summary
Modifier and Type Method Description voidaddXAdESPathsHolder(XAdESPaths xadesPathsHolder)This adds aXAdESPaths.voidclearQueryHolders()Removes all of the elements from the list of query holders.List<DSSDocument>getOriginalDocuments(AdvancedSignature advancedSignature)This method returns the signed document(s) without their signature(s)List<DSSDocument>getOriginalDocuments(String signatureId)This method returns the signed document(s) without their signature(s)DocumentgetRootElement()Returns the root element of the validating documentAdvancedSignaturegetSignatureById(String signatureId)Retrieves a signature based on its IdList<AdvancedSignature>getSignatures()Retrieves the signatures found in the documentList<XAdESPaths>getXAdESPathsHolder()This getter returns theXAdESPathsbooleanisSupported(DSSDocument dssDocument)Checks if the document is supported by the current validatorvoidsetDisableXSWProtection(boolean disableXSWProtection)NOT RECOMMENDED : This parameter allows to disable protection against XML Signature wrapping attacks (XSW).Methods inherited from class eu.europa.esig.dss.validation.SignedDocumentValidator
appendCounterSignatures, assertConfigurationValid, createDiagnosticDataBuilder, defineSigningCertificate, findSignatureScopes, fromDocument, getAllSignatures, getDefaultDigestAlgorithm, getDefaultProcessExecutor, getDetachedTimestamps, getSignaturePolicyProvider, getValidationTime, initializeDiagnosticDataBuilder, mergeCertificateSource, mergeCRLSources, mergeOCSPSources, prepareCertificatesAndTimestamps, prepareCertificateVerifier, prepareDetachedTimestampValidationContext, prepareDiagnosticDataBuilder, prepareSignatureValidationContext, processSignaturesValidation, processValidationPolicy, provideProcessExecutorInstance, setCertificateVerifier, setContainerContents, setDetachedContents, setEnableEtsiValidationReport, setIncludeSemantics, setLocale, setManifestFile, setProcessExecutor, setSignaturePolicyProvider, setSignedScopeFinderDefaultDigestAlgorithm, setSigningCertificateSource, setSkipValidationContextExecution, setTokenExtractionStrategy, setValidationLevel, setValidationTime, validateContext, validateDocument, validateDocument, validateDocument, validateDocument, validateDocument, validateDocument, validateDocument
-
Field Details
-
xadesPathsHolders
This variable contains the list ofXAdESPathsadapted to the specific signature schema. -
rootElement
The root element of the document to validate
-
-
Constructor Details
-
XMLDocumentValidator
The default constructor for XMLDocumentValidator. The created instance is initialised with defaultXAdESPaths.- Parameters:
dssDocument- The instance ofDSSDocumentto validate
-
-
Method Details
-
isSupported
Description copied from class:SignedDocumentValidatorChecks if the document is supported by the current validator- Specified by:
isSupportedin classSignedDocumentValidator- Parameters:
dssDocument-DSSDocumentto check- Returns:
- TRUE if the document is supported, FALSE otherwise
-
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
-
getSignatures
Description copied from interface:DocumentValidatorRetrieves the signatures found in the document- Specified by:
getSignaturesin interfaceDocumentValidator- Overrides:
getSignaturesin classSignedDocumentValidator- Returns:
- a list of AdvancedSignatures for validation purposes
-
getSignatureById
Retrieves a signature based on its Id- Parameters:
signatureId- the given Id- Returns:
- the corresponding
XAdESSignature - Throws:
DSSException- in case no Id is provided, or in case no signature was found for the given Id
-
getOriginalDocuments
Description copied from interface:DocumentValidatorThis method returns the signed document(s) without their signature(s)- Parameters:
signatureId- the DSS ID of the signature to extract original signer data for- Returns:
- list of
DSSDocuments
-
getOriginalDocuments
Description copied from interface:DocumentValidatorThis method returns the signed document(s) without their signature(s)- Parameters:
advancedSignature-AdvancedSignatureto find signer documents for- Returns:
- list of
DSSDocuments
-
getXAdESPathsHolder
This getter returns theXAdESPaths- Returns:
- a list of
XAdESPaths
-
addXAdESPathsHolder
This adds aXAdESPaths. This is useful when the signature follows a particular schema.- Parameters:
xadesPathsHolder-XAdESPaths
-
clearQueryHolders
public void clearQueryHolders()Removes all of the elements from the list of query holders. The list will be empty after this call returns. -
getRootElement
Returns the root element of the validating document- Returns:
Document
-