Class AbstractDocumentExtender<SP extends AbstractSignatureParameters<?>, TP extends TimestampParameters>
- Type Parameters:
SP-SerializableSignatureParametersspecifying the signature creation parametersTP-SerializableTimestampParametersspecifying the timestamp creation parameters, when applicable
- All Implemented Interfaces:
DocumentExtender
- Direct Known Subclasses:
ASiCWithCAdESDocumentExtender, ASiCWithXAdESDocumentExtender, CAdESDocumentExtender, JAdESDocumentExtender, PAdESDocumentExtender, XAdESDocumentExtender
eu.europa.esig.dss.spi.augmentation.DocumentExtender-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DSSDocumentThe document to be augmented (with the signatures)Fields inherited from class SignedDocumentExtender
certificateVerifier, services, tspSource -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract DocumentSignatureService<SP, TP> This method created a new instance ofDocumentSignatureServiceprotected abstract SPThis method returns a new instance of empty signature parameters, according to the given format implementationextendDocument(SignatureProfile signatureProfile) Performs augmentation of all signatures within the provided document according to the specified targetsignatureProfile.extendDocument(SignatureProfile signatureProfile, SerializableSignatureParameters... extensionParameters) Performs augmentation of all signatures within the provided document according to the specifiedaugmentationParameters, with format specificextensionParameters.extendDocument(SignatureProfile signatureProfile, List<DSSDocument> detachedContents) Performs augmentation of all signatures of a detached format within the provided document according to the specified targetsignatureProfile.extendDocument(SignatureProfile signatureProfile, List<DSSDocument> detachedContents, SerializableSignatureParameters... extensionParameters) Performs augmentation of all signatures of a detached format within the provided document according to the specified targetsignatureProfile, with format specificextensionParameters.protected SPfillSignatureParameters(SP signatureParameters, SignatureProfile signatureProfile, List<DSSDocument> detachedContents) This method fills thesignatureParameterswith the parameters from theaugmentationParametersprotected SignatureLevelgetSignatureLevel(SignatureProfile signatureProfile) Gets the targetSignatureLevelfor the givenSignatureProfilerelatively to the signature formatprotected SPinitSignatureParameters(SignatureProfile signatureProfile, List<DSSDocument> detachedContents, SerializableSignatureParameters... extensionParameters) This method initializes signature parameters to be used on the signature augmentationprotected DocumentSignatureService<SP, TP> This method initializes a newDocumentSignatureServiceprotected abstract booleanisSupportedParameters(SerializableSignatureParameters parameters) This method verifies whether the provided signature parameters are supported by the current implementationprotected abstract booleanisSupportedService(DocumentSignatureService<?, ?> service) This method verifies whether the provided document signature service is supported by the current implementationMethods inherited from class SignedDocumentExtender
fromDocument, getSignatureForm, isASiC, setCertificateVerifier, setServices, setTspSourceMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DocumentExtender
isSupported
-
Field Details
-
document
The document to be augmented (with the signatures)
-
-
Constructor Details
-
AbstractDocumentExtender
protected AbstractDocumentExtender()Empty constructor
-
-
Method Details
-
extendDocument
Description copied from interface:DocumentExtenderPerforms augmentation of all signatures within the provided document according to the specified targetsignatureProfile.- Parameters:
signatureProfile-SignatureProfileidentifying the desired target augmentation level- Returns:
DSSDocumentcontaining the augmented signatures, if the augmentation succeeds.
-
extendDocument
public DSSDocument extendDocument(SignatureProfile signatureProfile, List<DSSDocument> detachedContents) Description copied from interface:DocumentExtenderPerforms augmentation of all signatures of a detached format within the provided document according to the specified targetsignatureProfile.- Parameters:
signatureProfile-SignatureProfileidentifying the desired target augmentation leveldetachedContents- list ofDSSDocuments representing a signed content in case of a detached signature- Returns:
DSSDocumentcontaining the augmented signatures, if the augmentation succeeds.
-
extendDocument
public DSSDocument extendDocument(SignatureProfile signatureProfile, SerializableSignatureParameters... extensionParameters) Description copied from interface:DocumentExtenderPerforms augmentation of all signatures within the provided document according to the specifiedaugmentationParameters, with format specificextensionParameters.If
explicitParametersare provided, and they contain an implementation of parameters matching the current signature format, those signature parameters will be used explicitly on this signature augmentation. This can be useful when a signature augmentation process for a certain signature format should take into account particular signature constraints (i.e. /Contents size for a PAdES document time-stamp, etc.).NOTE 1: If the matching implementation of extension parameters found, and it contains
signatureLeveland/ordetachedContentsdefinition, the existing values will be used. Otherwise, the content of the extension parameters will be overwritten respectively. NOTE 2: The definition of extension parameters is order dependent. The first parameters matching the signature format implementation will be used.- Parameters:
signatureProfile-SignatureProfileidentifying the desired target augmentation levelextensionParameters- (optional)SerializableSignatureParameterscontaining format specific requirements- Returns:
DSSDocumentcontaining the augmented signatures, if the augmentation succeeds.
-
extendDocument
public DSSDocument extendDocument(SignatureProfile signatureProfile, List<DSSDocument> detachedContents, SerializableSignatureParameters... extensionParameters) Description copied from interface:DocumentExtenderPerforms augmentation of all signatures of a detached format within the provided document according to the specified targetsignatureProfile, with format specificextensionParameters.If
explicitParametersare provided, and they contain an implementation of parameters matching the current signature format, those signature parameters will be used explicitly on this signature augmentation. This can be useful when a signature augmentation process for a certain signature format should take into account particular signature constraints (i.e. /Contents size for a PAdES document time-stamp, etc.).NOTE 1: If the matching implementation of extension parameters found, and it contains
signatureLeveland/ordetachedContentsdefinition, the existing values will be used. Otherwise, the content of the extension parameters will be overwritten respectively. NOTE 2: The definition of extension parameters is order dependent. The first parameters matching the signature format implementation will be used.- Parameters:
signatureProfile-SignatureProfileidentifying the desired target augmentation leveldetachedContents- list ofDSSDocuments representing a signed content in case of a detached signatureextensionParameters- (optional)SerializableSignatureParameterscontaining format specific requirements- Returns:
DSSDocumentcontaining the augmented signatures, if the augmentation succeeds.
-
initSignatureService
This method initializes a newDocumentSignatureService- Returns:
DocumentSignatureService
-
createSignatureService
This method created a new instance ofDocumentSignatureService- Returns:
DocumentSignatureService
-
isSupportedService
This method verifies whether the provided document signature service is supported by the current implementation- Parameters:
service-DocumentSignatureServiceto check- Returns:
- TRUE if the service is supported by the current implementation, FALSE otherwise
-
initSignatureParameters
protected SP initSignatureParameters(SignatureProfile signatureProfile, List<DSSDocument> detachedContents, SerializableSignatureParameters... extensionParameters) This method initializes signature parameters to be used on the signature augmentation- Parameters:
signatureProfile-SignatureProfilerepresenting a target level on signature augmentationdetachedContents- a list ofDSSDocumentfor a detached signatureextensionParameters- array of format specificSerializableSignatureParameters, when applicable- Returns:
SerializableSignatureParameters
-
emptySignatureParameters
This method returns a new instance of empty signature parameters, according to the given format implementation- Returns:
SerializableSignatureParameters
-
isSupportedParameters
This method verifies whether the provided signature parameters are supported by the current implementation- Parameters:
parameters-SerializableSignatureParametersto check- Returns:
- TRUE if the parameters are supported by the current implementation, FALSE otherwise
-
fillSignatureParameters
protected SP fillSignatureParameters(SP signatureParameters, SignatureProfile signatureProfile, List<DSSDocument> detachedContents) This method fills thesignatureParameterswith the parameters from theaugmentationParameters- Parameters:
signatureParameters-SerializableSignatureParametersto fillsignatureProfile-SignatureProfilerepresenting a target level on signature augmentationdetachedContents- a list ofDSSDocumentfor a detached signature- Returns:
SerializableSignatureParameters
-
getSignatureLevel
Gets the targetSignatureLevelfor the givenSignatureProfilerelatively to the signature format- Parameters:
signatureProfile-SignatureProfile- Returns:
SignatureLevel
-