Class CAdESService
java.lang.Object
eu.europa.esig.dss.signature.AbstractSignatureService<CAdESSignatureParameters,CAdESTimestampParameters>
eu.europa.esig.dss.cades.signature.CAdESService
- All Implemented Interfaces:
DocumentSignatureService<CAdESSignatureParameters,CAdESTimestampParameters>
,Serializable
public class CAdESService extends AbstractSignatureService<CAdESSignatureParameters,CAdESTimestampParameters>
CAdES implementation of DocumentSignatureService
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class eu.europa.esig.dss.signature.AbstractSignatureService
certificateVerifier, tspSource
-
Constructor Summary
Constructors Constructor Description CAdESService(CertificateVerifier certificateVerifier)
This is the constructor to create an instance of theCAdESService
. -
Method Summary
Modifier and Type Method Description DSSDocument
extendDocument(DSSDocument toExtendDocument, CAdESSignatureParameters parameters)
Extends the level of the signatures in thetoExtendDocument
TimestampToken
getContentTimestamp(DSSDocument toSignDocument, CAdESSignatureParameters parameters)
This method allows to compute a content-timestamp (which is added in the signed properties)ToBeSigned
getDataToSign(DSSDocument toSignDocument, CAdESSignatureParameters parameters)
Retrieves the bytes of the data that need to be signed based on thetoSignDocument
andparameters
.DSSDocument
signDocument(DSSDocument toSignDocument, CAdESSignatureParameters parameters, SignatureValue signatureValue)
Signs the toSignDocument with the provided signatureValue.Methods inherited from class eu.europa.esig.dss.signature.AbstractSignatureService
assertSigningDateInCertificateValidityRange, getFinalArchiveName, getFinalFileName, setTspSource, timestamp
-
Constructor Details
-
CAdESService
This is the constructor to create an instance of theCAdESService
. A certificate verifier must be provided.- Parameters:
certificateVerifier
-CertificateVerifier
provides information on the sources to be used in the validation process in the context of a signature.
-
-
Method Details
-
getContentTimestamp
public TimestampToken getContentTimestamp(DSSDocument toSignDocument, CAdESSignatureParameters parameters)Description copied from interface:DocumentSignatureService
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
-
getDataToSign
public ToBeSigned getDataToSign(DSSDocument toSignDocument, CAdESSignatureParameters parameters) throws DSSExceptionDescription copied from interface:DocumentSignatureService
Retrieves the bytes of the data that need to be signed based on thetoSignDocument
andparameters
. WhentoSignDocument
contains 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
- Throws:
DSSException
-
signDocument
public DSSDocument signDocument(DSSDocument toSignDocument, CAdESSignatureParameters parameters, SignatureValue signatureValue) throws DSSExceptionDescription copied from interface:DocumentSignatureService
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 (
toSignDocument
with the incorporated signature or the detached signature) - Throws:
DSSException
-
extendDocument
public DSSDocument extendDocument(DSSDocument toExtendDocument, CAdESSignatureParameters parameters)Description copied from interface:DocumentSignatureService
Extends the level of the signatures in thetoExtendDocument
- Parameters:
toExtendDocument
- document to extendparameters
- set of the driving signing parameters- Returns:
- the extended signature
-