Package eu.europa.esig.dss.signature
Interface DocumentSignatureService<SP extends SerializableSignatureParameters,TP extends SerializableTimestampParameters>
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractASiCSignatureService,AbstractSignatureService,ASiCWithCAdESService,ASiCWithXAdESService,CAdESService,PAdESService,XAdESService
public interface DocumentSignatureService<SP extends SerializableSignatureParameters,TP extends SerializableTimestampParameters> extends Serializable
This interface
DocumentSignatureService provides operations for the signature creation and for its extension.-
Method Summary
Modifier and Type Method Description DSSDocumentextendDocument(DSSDocument toExtendDocument, SP parameters)Extends the level of the signatures in thetoExtendDocumentTimestampTokengetContentTimestamp(DSSDocument toSignDocument, SP parameters)This method allows to compute a content-timestamp (which is added in the signed properties)ToBeSignedgetDataToSign(DSSDocument toSignDocument, SP parameters)Retrieves the bytes of the data that need to be signed based on thetoSignDocumentandparameters.voidsetTspSource(TSPSource tspSource)This setter allows to define the TSP (timestamp provider) source.DSSDocumentsignDocument(DSSDocument toSignDocument, SP parameters, SignatureValue signatureValue)Signs the toSignDocument with the provided signatureValue.DSSDocumenttimestamp(DSSDocument toTimestampDocument, TP parameters)This method allows to add a timestamp to an unsigned document
-
Method Details
-
getDataToSign
Retrieves the bytes of the data that need to be signed based on thetoSignDocumentandparameters. WhentoSignDocumentcontains an already existing signature the returned bytes are related to a new parallel signature. - Enveloped signature (XML): a new signature is added and the signed data corresponds to that pointed by the first signature; - Enveloping signature: - - XML: The parallel signature is not possible - - CMS: A new parallel signature is added - Detached signature: - - XML: The parallel signature is added - - CMS: A new parallel signature is added- Parameters:
toSignDocument- document to sign or the already existing signatureparameters- set of the driving signing parameters- Returns:
- the data to be signed
-
signDocument
Signs the toSignDocument with the provided signatureValue.- Parameters:
toSignDocument- document to signparameters- set of the driving signing parameterssignatureValue- the signature value to incorporate- Returns:
- the signed document (
toSignDocumentwith the incorporated signature or the detached signature)
-
extendDocument
Extends the level of the signatures in thetoExtendDocument- Parameters:
toExtendDocument- document to extendparameters- set of the driving signing parameters- Returns:
- the extended signature
-
setTspSource
This setter allows to define the TSP (timestamp provider) source.- Parameters:
tspSource- The time stamp source which is used when timestamping the signature.
-
getContentTimestamp
This method allows to compute a content-timestamp (which is added in the signed properties)- Parameters:
toSignDocument- document to sign or the already existing signatureparameters- set of the driving signing parameters- Returns:
- a timestamp token
-
timestamp
This method allows to add a timestamp to an unsigned document- Parameters:
toTimestampDocument- the document to be timestampedparameters- set of the driving timestamping parameters- Returns:
- the timestamped document
-