Class ExtensionBuilder
java.lang.Object
eu.europa.esig.dss.xades.signature.XAdESBuilder
eu.europa.esig.dss.xades.signature.ExtensionBuilder
- Direct Known Subclasses:
CounterSignatureBuilder,SignaturePolicyStoreBuilder,XAdESLevelBaselineT
public abstract class ExtensionBuilder extends XAdESBuilder
Builds XAdES signature extension
-
Field Summary
Fields Modifier and Type Field Description protected ElementcurrentSignatureDomThis field represents the current signature being extended.protected ElementqualifyingPropertiesDomThis field represents the signature qualifying propertiesprotected ElementunsignedPropertiesDomThis field represents the unsigned propertiesprotected ElementunsignedSignaturePropertiesDomThis field contains unsigned signature propertiesprotected XAdESSignaturexadesSignatureThis object allows to access DOM signature representation using XPATHFields inherited from class eu.europa.esig.dss.xades.signature.XAdESBuilder
certificateVerifier, documentDom, params, REFERENCED_DATA, TARGET, URI, xadesPaths -
Constructor Summary
Constructors Modifier Constructor Description protectedExtensionBuilder(CertificateVerifier certificateVerifier)Default constructor -
Method Summary
Modifier and Type Method Description protected voidalignNodes()protected voidassertSignatureValid(XAdESSignature xadesSignature)Verifies if the signature is valid.protected voidensureSignedDataObjectProperties()Returns or create (if it does not exist) the SignedDataObjectProperties DOM object.protected voidensureUnsignedProperties()Returns or creates (if it does not exist) the UnsignedPropertiesType DOM object.protected voidensureUnsignedSignatureProperties()Returns or creates (if it does not exist) the UnsignedSignaturePropertiesType DOM object.protected NodeListgetSignaturesNodeListToExtend(Document documentDom)Returns aNodeListof signatures to be extended.protected DSSNamespacegetXadesNamespace()This method returns the current used XAdES namespace.protected DSSNamespacegetXmldsigNamespace()This method returns the current used XMLDSig namespace.protected ElementindentIfPrettyPrint(Element nodeToIndent, Element oldNode)Indents thenodeToIndentif pretty-print is enabledprotected StringremoveChild(Node parentNode, Node nodeToRemove)Removes the given nodeToRemove from its parentNodeMethods inherited from class eu.europa.esig.dss.xades.signature.XAdESBuilder
createXmlDocument, getCurrentXAdESElements, getCurrentXAdESPaths, getReferenceDigestAlgorithmOrDefault, getXades141Namespace, incorporateCert, incorporateCertificateRef, incorporateDigestMethod, incorporateDigestValue, incorporateDigestValue, incorporateIssuerV1, incorporateIssuerV2
-
Field Details
-
xadesSignature
This object allows to access DOM signature representation using XPATH -
currentSignatureDom
This field represents the current signature being extended. -
qualifyingPropertiesDom
This field represents the signature qualifying properties -
unsignedPropertiesDom
This field represents the unsigned properties -
unsignedSignaturePropertiesDom
This field contains unsigned signature properties
-
-
Constructor Details
-
ExtensionBuilder
Default constructor- Parameters:
certificateVerifier-CertificateVerifier
-
-
Method Details
-
ensureUnsignedProperties
protected void ensureUnsignedProperties()Returns or creates (if it does not exist) the UnsignedPropertiesType DOM object. -
ensureUnsignedSignatureProperties
protected void ensureUnsignedSignatureProperties()Returns or creates (if it does not exist) the UnsignedSignaturePropertiesType DOM object. -
ensureSignedDataObjectProperties
protected void ensureSignedDataObjectProperties()Returns or create (if it does not exist) the SignedDataObjectProperties DOM object. -
assertSignatureValid
Verifies if the signature is valid. Throws an exception if the signature is invalid.- Parameters:
xadesSignature-XAdESSignatureto check
-
indentIfPrettyPrint
Indents thenodeToIndentif pretty-print is enabled -
alignNodes
protected void alignNodes()- Specified by:
alignNodesin classXAdESBuilder
-
removeChild
Removes the given nodeToRemove from its parentNode -
getXmldsigNamespace
This method returns the current used XMLDSig namespace. Try to determine from the signature, from the parameters or the default value- Overrides:
getXmldsigNamespacein classXAdESBuilder- Returns:
DSSNamespace
-
getXadesNamespace
This method returns the current used XAdES namespace. Try to determine from the signature, from the parameters or the default value- Overrides:
getXadesNamespacein classXAdESBuilder- Returns:
DSSNamespace
-
getSignaturesNodeListToExtend
Returns aNodeListof signatures to be extended. Throws an extension if no valid signatures found
-