Class XAdESBuilder
java.lang.Object
eu.europa.esig.dss.xades.signature.XAdESBuilder
- Direct Known Subclasses:
ExtensionBuilder
,XAdESSignatureBuilder
public abstract class XAdESBuilder extends Object
-
Field Summary
Fields Modifier and Type Field Description protected CertificateVerifier
certificateVerifier
Reference to the object in charge of certificates validationprotected Document
documentDom
This is the variable which represents the root XML document root (with signature).protected XAdESSignatureParameters
params
static String
REFERENCED_DATA
static String
SIGNATURE
static String
TARGET
static String
URI
protected XAdESPaths
xadesPaths
This variable holds theXAdESPaths
which contains all constants and queries needed to cope with the default signature schema. -
Constructor Summary
Constructors Constructor Description XAdESBuilder(CertificateVerifier certificateVerifier)
The default constructor. -
Method Summary
Modifier and Type Method Description protected abstract void
alignNodes()
protected DSSDocument
createXmlDocument()
CreatesDSSDocument
from the current documentDomprotected XAdESElement
getCurrentXAdESElements()
protected XAdESPaths
getCurrentXAdESPaths()
protected DSSNamespace
getXades141Namespace()
This method returns the current used XAdES 1.4.1 namespace.protected DSSNamespace
getXadesNamespace()
This method returns the current used XAdES namespace.protected DSSNamespace
getXmldsigNamespace()
This method returns the current used XMLDSig namespace.protected Element
incorporateCert(Element parentDom, CertificateToken certificate)
Creates Cert DOM object:protected void
incorporateCertificateRef(Element signingCertificateDom, Set<CertificateToken> certificates)
Incorporates the certificate's references as a child of the given parent node.protected void
incorporateDigestMethod(Element parentDom, DigestAlgorithm digestAlgorithm)
This method creates the ds:DigestMethod DOM objectprotected void
incorporateDigestValue(Element parentDom, DigestAlgorithm digestAlgorithm, Token token)
This method creates the ds:DigestValue DOM object.protected void
incorporateDigestValue(Element parentDom, DSSReference dssReference, DigestAlgorithm digestAlgorithm, DSSDocument originalDocument)
This method creates the ds:DigestValue DOM object.protected void
incorporateIssuerV1(Element parentDom, CertificateToken certificate)
protected void
incorporateIssuerV2(Element parentDom, CertificateToken certificate)
-
Field Details
-
REFERENCED_DATA
- See Also:
- Constant Field Values
-
SIGNATURE
- See Also:
- Constant Field Values
-
TARGET
- See Also:
- Constant Field Values
-
URI
- See Also:
- Constant Field Values
-
xadesPaths
This variable holds theXAdESPaths
which contains all constants and queries needed to cope with the default signature schema. -
params
-
documentDom
This is the variable which represents the root XML document root (with signature). -
certificateVerifier
Reference to the object in charge of certificates validation
-
-
Constructor Details
-
XAdESBuilder
The default constructor.- Parameters:
certificateVerifier
-CertificateVerifier
-
-
Method Details
-
incorporateDigestMethod
This method creates the ds:DigestMethod DOM object<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
- Parameters:
parentDom
- the parent elementdigestAlgorithm
- the digest algorithm xml identifier
-
incorporateDigestValue
protected void incorporateDigestValue(Element parentDom, DSSReference dssReference, DigestAlgorithm digestAlgorithm, DSSDocument originalDocument)This method creates the ds:DigestValue DOM object.<ds:DigestValue>fj8SJujSXU4fi342bdtiKVbglA0=</ds:DigestValue>
- Parameters:
parentDom
- the parent elementdssReference
- the current reference to incorporatedigestAlgorithm
- the digest algorithm to be usedoriginalDocument
- the document to be digested
-
incorporateDigestValue
protected void incorporateDigestValue(Element parentDom, DigestAlgorithm digestAlgorithm, Token token)This method creates the ds:DigestValue DOM object.<ds:DigestValue>fj8SJujSXU4fi342bdtiKVbglA0=</ds:DigestValue>
- Parameters:
parentDom
- the parent elementdigestAlgorithm
- the digest algorithm to usetoken
- the token to be digested
-
incorporateCertificateRef
protected void incorporateCertificateRef(Element signingCertificateDom, Set<CertificateToken> certificates)Incorporates the certificate's references as a child of the given parent node. The first element of theX509Certificate
List
MUST be the signing certificate.- Parameters:
signingCertificateDom
- DOM parent elementcertificates
-List
of the certificates to be incorporated
-
incorporateCert
Creates Cert DOM object:<Cert> <CertDigest> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>fj8SJujSXU4fi342bdtiKVbglA0=</ds:DigestValue> </CertDigest> <IssuerSerial> <ds:X509IssuerName>CN=ICA A,O=DSS,C=AA</ds:X509IssuerName> <ds:X509SerialNumber>4</ds:X509SerialNumber> </IssuerSerial> </Cert>
- Parameters:
parentDom
- the parent elementcertificate
- the certificate to be added
-
incorporateIssuerV1
-
incorporateIssuerV2
-
createXmlDocument
CreatesDSSDocument
from the current documentDom- Returns:
DSSDocument
-
alignNodes
protected abstract void alignNodes() -
getXmldsigNamespace
This method returns the current used XMLDSig namespace. Try to determine from the signature, from the parameters or the default value -
getXadesNamespace
This method returns the current used XAdES namespace. Try to determine from the signature, from the parameters or the default value -
getXades141Namespace
This method returns the current used XAdES 1.4.1 namespace. Try to determine from the signature, from the parameters or the default value -
getCurrentXAdESElements
-
getCurrentXAdESPaths
-