public class PdfPadesSigner extends Object
| Constructor and Description |
|---|
PdfPadesSigner(PdfReader reader,
OutputStream outputStream)
Create an instance of PdfPadesSigner class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
prolongSignatures()
Add revocation information for all the signatures which could be found in the provided document.
|
void |
prolongSignatures(ITSAClient tsaClient)
Add revocation information for all the signatures which could be found in the provided document.
|
PdfPadesSigner |
setCrlClient(ICrlClient crlClient)
Set
ICrlClient to be used for LTV Verification. |
PdfPadesSigner |
setEstimatedSize(int estimatedSize)
Set estimated size of a signature to be applied.
|
PdfPadesSigner |
setExternalDigest(IExternalDigest externalDigest)
Set
IExternalDigest to be used for main signing operation. |
PdfPadesSigner |
setIssuingCertificateRetriever(IIssuingCertificateRetriever issuingCertificateRetriever)
Set
IIssuingCertificateRetriever to be used before main signing operation. |
PdfPadesSigner |
setOcspClient(IOcspClient ocspClient)
Set
IOcspClient to be used for LTV Verification. |
PdfPadesSigner |
setStampingProperties(StampingProperties stampingProperties)
Set stamping properties to be used during main signing operation.
|
PdfPadesSigner |
setTemporaryDirectoryPath(String temporaryDirectoryPath)
Set temporary directory to be used for temporary files creation.
|
PdfPadesSigner |
setTimestampSignatureName(String timestampSignatureName)
Set the name to be used for timestamp signature creation.
|
PdfPadesSigner |
setTrustedCertificates(List<Certificate> certificateList)
Set certificate list to be used by the
IIssuingCertificateRetriever to retrieve missing certificates. |
void |
signWithBaselineBProfile(SignerProperties signerProperties,
Certificate[] chain,
IExternalSignature externalSignature)
Sign the document provided in
PdfSigner instance with PaDES Baseline-B Profile. |
void |
signWithBaselineBProfile(SignerProperties signerProperties,
Certificate[] chain,
PrivateKey privateKey)
Sign the document provided in
PdfSigner instance with PaDES Baseline-B Profile. |
void |
signWithBaselineLTAProfile(SignerProperties signerProperties,
Certificate[] chain,
IExternalSignature externalSignature,
ITSAClient tsaClient)
Sign the document provided in
PdfSigner instance with PaDES Baseline-LTA Profile. |
void |
signWithBaselineLTAProfile(SignerProperties signerProperties,
Certificate[] chain,
PrivateKey privateKey,
ITSAClient tsaClient)
Sign the document provided in
PdfSigner instance with PaDES Baseline-LTA Profile. |
void |
signWithBaselineLTProfile(SignerProperties signerProperties,
Certificate[] chain,
IExternalSignature externalSignature,
ITSAClient tsaClient)
Sign the document provided in
PdfSigner instance with PaDES Baseline-LT Profile. |
void |
signWithBaselineLTProfile(SignerProperties signerProperties,
Certificate[] chain,
PrivateKey privateKey,
ITSAClient tsaClient)
Sign the document provided in
PdfSigner instance with PaDES Baseline-LT Profile. |
void |
signWithBaselineTProfile(SignerProperties signerProperties,
Certificate[] chain,
IExternalSignature externalSignature,
ITSAClient tsaClient)
Sign the document provided in
PdfSigner instance with PaDES Baseline-T Profile. |
void |
signWithBaselineTProfile(SignerProperties signerProperties,
Certificate[] chain,
PrivateKey privateKey,
ITSAClient tsaClient)
Sign the document provided in
PdfSigner instance with PaDES Baseline-T Profile. |
public PdfPadesSigner(PdfReader reader, OutputStream outputStream)
reader - PdfReader instance to read original PDF fileoutputStream - OutputStream output stream to write the resulting PDF file intopublic void signWithBaselineBProfile(SignerProperties signerProperties, Certificate[] chain, IExternalSignature externalSignature) throws GeneralSecurityException, IOException
PdfSigner instance with PaDES Baseline-B Profile.signerProperties - SignerProperties properties to be used for main signing operationchain - the chain of certificates to be used for signing operationexternalSignature - IExternalSignature instance to be used for main signing operationGeneralSecurityException - in case of signing related exceptionsIOException - in case of files related exceptionspublic void signWithBaselineBProfile(SignerProperties signerProperties, Certificate[] chain, PrivateKey privateKey) throws GeneralSecurityException, IOException
PdfSigner instance with PaDES Baseline-B Profile.signerProperties - SignerProperties properties to be used for main signing operationchain - the chain of certificates to be used for signing operationprivateKey - PrivateKey instance to be used for main signing operationGeneralSecurityException - in case of signing related exceptionsIOException - in case of files related exceptionspublic void signWithBaselineTProfile(SignerProperties signerProperties, Certificate[] chain, IExternalSignature externalSignature, ITSAClient tsaClient) throws GeneralSecurityException, IOException
PdfSigner instance with PaDES Baseline-T Profile.signerProperties - SignerProperties properties to be used for main signing operationchain - the chain of certificates to be used for signing operationexternalSignature - IExternalSignature instance to be used for main signing operationtsaClient - ITSAClient instance to be used for timestamp creationGeneralSecurityException - in case of signing related exceptionsIOException - in case of files related exceptionspublic void signWithBaselineTProfile(SignerProperties signerProperties, Certificate[] chain, PrivateKey privateKey, ITSAClient tsaClient) throws GeneralSecurityException, IOException
PdfSigner instance with PaDES Baseline-T Profile.signerProperties - SignerProperties properties to be used for main signing operationchain - the chain of certificates to be used for signing operationprivateKey - PrivateKey instance to be used for main signing operationtsaClient - ITSAClient instance to be used for timestamp creationGeneralSecurityException - in case of signing related exceptionsIOException - in case of files related exceptionspublic void signWithBaselineLTProfile(SignerProperties signerProperties, Certificate[] chain, IExternalSignature externalSignature, ITSAClient tsaClient) throws GeneralSecurityException, IOException
PdfSigner instance with PaDES Baseline-LT Profile.signerProperties - SignerProperties properties to be used for main signing operationchain - the chain of certificates to be used for signing operationexternalSignature - IExternalSignature instance to be used for main signing operationtsaClient - ITSAClient instance to be used for timestamp creationGeneralSecurityException - in case of signing related exceptionsIOException - in case of files related exceptionspublic void signWithBaselineLTProfile(SignerProperties signerProperties, Certificate[] chain, PrivateKey privateKey, ITSAClient tsaClient) throws GeneralSecurityException, IOException
PdfSigner instance with PaDES Baseline-LT Profile.signerProperties - SignerProperties properties to be used for main signing operationchain - the chain of certificates to be used for signing operationprivateKey - PrivateKey instance to be used for main signing operationtsaClient - ITSAClient instance to be used for timestamp creationGeneralSecurityException - in case of signing related exceptionsIOException - in case of files related exceptionspublic void signWithBaselineLTAProfile(SignerProperties signerProperties, Certificate[] chain, IExternalSignature externalSignature, ITSAClient tsaClient) throws IOException, GeneralSecurityException
PdfSigner instance with PaDES Baseline-LTA Profile.signerProperties - SignerProperties properties to be used for main signing operationchain - the chain of certificates to be used for signing operationexternalSignature - IExternalSignature instance to be used for main signing operationtsaClient - ITSAClient instance to be used for timestamp creationGeneralSecurityException - in case of signing related exceptionsIOException - in case of files related exceptionspublic void signWithBaselineLTAProfile(SignerProperties signerProperties, Certificate[] chain, PrivateKey privateKey, ITSAClient tsaClient) throws GeneralSecurityException, IOException
PdfSigner instance with PaDES Baseline-LTA Profile.signerProperties - SignerProperties properties to be used for main signing operationchain - the chain of certificates to be used for signing operationprivateKey - PrivateKey instance to be used for main signing operationtsaClient - ITSAClient instance to be used for timestamp creationGeneralSecurityException - in case of signing related exceptionsIOException - in case of files related exceptionspublic void prolongSignatures(ITSAClient tsaClient) throws IOException, GeneralSecurityException
tsaClient - ITSAClient TSA Client to be used for timestamp signature creationIOException - in case of files related exceptionsGeneralSecurityException - in case of signing related exceptionspublic void prolongSignatures()
throws IOException,
GeneralSecurityException
IOException - in case of files related exceptionsGeneralSecurityException - in case of signing related exceptionspublic PdfPadesSigner setTemporaryDirectoryPath(String temporaryDirectoryPath)
If none is set, temporary documents will be created in memory.
temporaryDirectoryPath - String representing relative or absolute path to the directoryPdfPadesSignerpublic PdfPadesSigner setTimestampSignatureName(String timestampSignatureName)
This setter is only relevant if
signWithBaselineLTAProfile(com.itextpdf.signatures.SignerProperties, java.security.cert.Certificate[], com.itextpdf.signatures.IExternalSignature, com.itextpdf.signatures.ITSAClient) or prolongSignatures(com.itextpdf.signatures.ITSAClient) methods are used.
If none is set, randomly generated signature name will be used.
timestampSignatureName - String representing the name of a timestamp signature to be appliedPdfPadesSignerpublic PdfPadesSigner setStampingProperties(StampingProperties stampingProperties)
If none is set, stamping properties with append mode enabled will be used
stampingProperties - StampingProperties instance to be used during main signing operationPdfPadesSignerpublic PdfPadesSigner setEstimatedSize(int estimatedSize)
This parameter represents estimated amount of bytes to be preserved for the signature.
If none is set, 0 will be used and the required space will be calculated during the signing.
estimatedSize - amount of bytes to be used as estimated valuePdfPadesSignerpublic PdfPadesSigner setOcspClient(IOcspClient ocspClient)
IOcspClient to be used for LTV Verification.
This setter is only relevant if Baseline-LT Profile level or higher is used.
If none is set, there will be an attempt to create default OCSP Client instance using the certificate chain.
ocspClient - IOcspClient instance to be used for LTV VerificationPdfPadesSignerpublic PdfPadesSigner setCrlClient(ICrlClient crlClient)
ICrlClient to be used for LTV Verification.
This setter is only relevant if Baseline-LT Profile level or higher is used.
If none is set, there will be an attempt to create default CRL Client instance using the certificate chain.
crlClient - ICrlClient instance to be used for LTV VerificationPdfPadesSignerpublic PdfPadesSigner setExternalDigest(IExternalDigest externalDigest)
IExternalDigest to be used for main signing operation.
If none is set, BouncyCastleDigest instance will be used instead.
externalDigest - IExternalDigest to be used for main signing operation.PdfPadesSignerpublic PdfPadesSigner setIssuingCertificateRetriever(IIssuingCertificateRetriever issuingCertificateRetriever)
IIssuingCertificateRetriever to be used before main signing operation.
If none is set, IssuingCertificateRetriever instance will be used instead.
issuingCertificateRetriever - IIssuingCertificateRetriever instance to be used for getting missing
certificates in chain or CRL response issuer certificates.PdfPadesSigner.public PdfPadesSigner setTrustedCertificates(List<Certificate> certificateList)
IIssuingCertificateRetriever to retrieve missing certificates.certificateList - certificate list for getting missing certificates in chain
or CRL response issuer certificates.PdfPadesSigner.Copyright © 1998–2024 Apryse Group NV. All rights reserved.