Class XAdESBuilder
java.lang.Object
eu.europa.esig.dss.xades.signature.XAdESBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CertificateVerifierReference to the object in charge of certificates validationprotected DocumentThis is the variable which represents the root XML document root (with signature).protected static final StringId-prefix for EncapsulatedTimeStamp elementprotected static final StringXml Id prefixprotected XAdESSignatureParametersThis variable is a reference to the set of parameters relating to the structure and process of the creation or extension of the electronic signature.static final StringThe attribute used for timestamp includesstatic final StringThe qualifying properties targetprotected static final StringId-prefix for TimeStamp elementstatic final StringThe URI attributeprotected XAdESPathThis variable holds theXAdESPathswhich contains all constants and queries needed to cope with the default signature schema. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEmpty constructorprotectedXAdESBuilder(CertificateVerifier certificateVerifier) The default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidThis method is used to align children indentsprotected DSSDocumentCreatesDSSDocumentfrom the current documentDomprotected XAdESElementGets a relevant class containing the list of elementsprotected XAdESPathGets a relevant class containing the list of pathsprotected DSSNamespaceThis method returns the current used XAdES 1.4.1 namespaceprotected DSSNamespaceThis method returns the current used XAdES namespaceprotected DSSNamespaceThis method returns the current used XMLDSig namespaceprotected ElementincorporateCert(Element parentDom, CertificateToken certificate, DigestAlgorithm digestAlgorithm) Creates Cert DOM object:protected voidincorporateCertDigest(Element parentDom, DigestAlgorithm digestAlgorithm, Token token) This method creates the xades:CertDigest DOM object.protected voidincorporateDigestMethod(Element parentDom, DigestAlgorithm digestAlgorithm) This method creates the ds:DigestMethod DOM object.protected voidincorporateDigestValue(Element parentDom, DigestAlgorithm digestAlgorithm, Token token) This method creates the ds:DigestValue DOM object for a givenTokenprotected voidincorporateDigestValue(Element parentDom, String base64EncodedDigestBytes) This method creates the ds:DigestValue DOM object.protected voidincorporateIssuerV1(Element parentDom, CertificateToken certificate) Incorporates IssuerSerial elementprotected voidincorporateIssuerV2(Element parentDom, CertificateToken certificate) Incorporates IssuerSerialV2 elementprotected voidincorporateSPDocSpecification(Element parentElement, SpDocSpecification spDocSpecification) Creates SpDocSpecification DOM object:protected StringtoXmlIdentifier(Identifier identifier) Transforms a DSS Identifier to an XML Id type
-
Field Details
-
REFERENCED_DATA
-
TARGET
-
URI
-
ID_PREFIX
-
TIMESTAMP_PREFIX
-
ENCAPSULATED_TIMESTAMP_PREFIX
Id-prefix for EncapsulatedTimeStamp element- See Also:
-
xadesPath
This variable holds theXAdESPathswhich contains all constants and queries needed to cope with the default signature schema. -
params
This variable is a reference to the set of parameters relating to the structure and process of the creation or extension of the electronic signature. -
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
protected XAdESBuilder()Empty constructor -
XAdESBuilder
The default constructor.- Parameters:
certificateVerifier-CertificateVerifier
-
-
Method Details
-
incorporateCertDigest
protected void incorporateCertDigest(Element parentDom, DigestAlgorithm digestAlgorithm, Token token) This method creates the xades:CertDigest DOM object.<CertDigest> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>fj8SJujSXU4fi342bdtiKVbglA0=</ds:DigestValue> </CertDigest>- Parameters:
parentDom- the parent elementdigestAlgorithm- the digest algorithm to usetoken- the token to be digested
-
incorporateDigestMethod
This method creates the ds:DigestMethod DOM object.<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>- Parameters:
parentDom- the parent elementdigestAlgorithm- the digest algorithm to use
-
incorporateDigestValue
protected void incorporateDigestValue(Element parentDom, DigestAlgorithm digestAlgorithm, Token token) This method creates the ds:DigestValue DOM object for a givenToken<ds:DigestValue>fj8SJujSXU4fi342bdtiKVbglA0=</ds:DigestValue>- Parameters:
parentDom- the parent elementdigestAlgorithm- the digest algorithm to usetoken-Tokento compute Digest from
-
incorporateDigestValue
This method creates the ds:DigestValue DOM object.<ds:DigestValue>fj8SJujSXU4fi342bdtiKVbglA0=</ds:DigestValue> -
incorporateCert
protected Element incorporateCert(Element parentDom, CertificateToken certificate, DigestAlgorithm digestAlgorithm) 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 addeddigestAlgorithm-DigestAlgorithmto use- Returns:
Element
-
incorporateIssuerV1
Incorporates IssuerSerial element- Parameters:
parentDom-Elementcertificate-CertificateTokento get issuer for
-
incorporateIssuerV2
Incorporates IssuerSerialV2 element- Parameters:
parentDom-Elementcertificate-CertificateTokento get issuer for
-
createXmlDocument
CreatesDSSDocumentfrom the current documentDom- Returns:
DSSDocument
-
alignNodes
protected abstract void alignNodes()This method is used to align children indents -
getXmldsigNamespace
This method returns the current used XMLDSig namespace- Returns:
DSSNamespace
-
getXadesNamespace
This method returns the current used XAdES namespace- Returns:
DSSNamespace
-
getXades141Namespace
This method returns the current used XAdES 1.4.1 namespace- Returns:
DSSNamespace
-
getCurrentXAdESElements
Gets a relevant class containing the list of elements- Returns:
XAdESElementimplementation
-
getCurrentXAdESPath
-
incorporateSPDocSpecification
protected void incorporateSPDocSpecification(Element parentElement, SpDocSpecification spDocSpecification) Creates SpDocSpecification DOM object:<xades141:SPDocSpecification xmlns:xades141="http://uri.etsi.org/01903/v1.4.1#"> <xades:Identifier>1.2.3.4.5</xades:Identifier> </xades141:SPDocSpecification>- Parameters:
parentElement-Elementelement to create the new object insidespDocSpecification-SpDocSpecification
-
toXmlIdentifier
Transforms a DSS Identifier to an XML Id type- Parameters:
identifier-Identifierto transform- Returns:
String
-