public class MakeSignature extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MakeSignature.CryptoStandard |
Constructor and Description |
---|
MakeSignature() |
Modifier and Type | Method and Description |
---|---|
static Collection |
processCrl(Certificate cert, Collection<CrlClient> crlList)
Processes a CRL list.
|
static void |
signDeferred(PdfReader reader, String fieldName, OutputStream outs, ExternalSignatureContainer externalSignatureContainer)
Signs a PDF where space was already reserved.
|
static void |
signDetached(PdfSignatureAppearance sap, ExternalDigest externalDigest, ExternalSignature externalSignature, Certificate[] chain, Collection<CrlClient> crlList, OcspClient ocspClient, TSAClient tsaClient, int estimatedSize, MakeSignature.CryptoStandard sigtype)
Signs the document using the detached mode, CMS or CAdES equivalent.
|
static void |
signDetached(PdfSignatureAppearance sap, ExternalDigest externalDigest, ExternalSignature externalSignature, Certificate[] chain, Collection<CrlClient> crlList, OcspClient ocspClient, TSAClient tsaClient, int estimatedSize, MakeSignature.CryptoStandard sigtype, org.bouncycastle.asn1.esf.SignaturePolicyIdentifier signaturePolicy)
Signs the document using the detached mode, CMS or CAdES equivalent.
|
static void |
signDetached(PdfSignatureAppearance sap, ExternalDigest externalDigest, ExternalSignature externalSignature, Certificate[] chain, Collection<CrlClient> crlList, OcspClient ocspClient, TSAClient tsaClient, int estimatedSize, MakeSignature.CryptoStandard sigtype, SignaturePolicyInfo signaturePolicy)
Signs the document using the detached mode, CMS or CAdES equivalent.
|
static void |
signExternalContainer(PdfSignatureAppearance sap, ExternalSignatureContainer externalSignatureContainer, int estimatedSize)
Sign the document using an external container, usually a PKCS7.
|
public static void signDetached(PdfSignatureAppearance sap, ExternalDigest externalDigest, ExternalSignature externalSignature, Certificate[] chain, Collection<CrlClient> crlList, OcspClient ocspClient, TSAClient tsaClient, int estimatedSize, MakeSignature.CryptoStandard sigtype) throws IOException, DocumentException, GeneralSecurityException
sap
- the PdfSignatureAppearance
externalSignature
- the interface providing the actual signing
chain
- the certificate chain
crlList
- the CRL list
ocspClient
- the OCSP client
tsaClient
- the Timestamp client
externalDigest
- an implementation that provides the digest
estimatedSize
- the reserved size for the signature. It will be estimated if 0
sigtype
- Either Signature.CMS or Signature.CADES
DocumentException
IOException
GeneralSecurityException
NoSuchAlgorithmException
Exception
public static void signDetached(PdfSignatureAppearance sap, ExternalDigest externalDigest, ExternalSignature externalSignature, Certificate[] chain, Collection<CrlClient> crlList, OcspClient ocspClient, TSAClient tsaClient, int estimatedSize, MakeSignature.CryptoStandard sigtype, SignaturePolicyInfo signaturePolicy) throws IOException, DocumentException, GeneralSecurityException
sap
- the PdfSignatureAppearance
externalSignature
- the interface providing the actual signing
chain
- the certificate chain
crlList
- the CRL list
ocspClient
- the OCSP client
tsaClient
- the Timestamp client
externalDigest
- an implementation that provides the digest
estimatedSize
- the reserved size for the signature. It will be estimated if 0
sigtype
- Either Signature.CMS or Signature.CADES
signaturePolicy
- the signature policy (for EPES signatures)
DocumentException
IOException
GeneralSecurityException
NoSuchAlgorithmException
Exception
public static void signDetached(PdfSignatureAppearance sap, ExternalDigest externalDigest, ExternalSignature externalSignature, Certificate[] chain, Collection<CrlClient> crlList, OcspClient ocspClient, TSAClient tsaClient, int estimatedSize, MakeSignature.CryptoStandard sigtype, org.bouncycastle.asn1.esf.SignaturePolicyIdentifier signaturePolicy) throws IOException, DocumentException, GeneralSecurityException
sap
- the PdfSignatureAppearance
externalSignature
- the interface providing the actual signing
chain
- the certificate chain
crlList
- the CRL list
ocspClient
- the OCSP client
tsaClient
- the Timestamp client
externalDigest
- an implementation that provides the digest
estimatedSize
- the reserved size for the signature. It will be estimated if 0
sigtype
- Either Signature.CMS or Signature.CADES
signaturePolicy
- the signature policy (for EPES signatures)
DocumentException
IOException
GeneralSecurityException
NoSuchAlgorithmException
Exception
public static CollectionprocessCrl(Certificate cert, Collection<CrlClient> crlList)
cert
- a Certificate if one of the CrlList implementations needs to retrieve the CRL URL from it.
crlList
- a list of CrlClient implementations
public static void signExternalContainer(PdfSignatureAppearance sap, ExternalSignatureContainer externalSignatureContainer, int estimatedSize) throws GeneralSecurityException, IOException, DocumentException
sap
- the PdfSignatureAppearance
externalSignatureContainer
- the interface providing the actual signing
estimatedSize
- the reserved size for the signature
GeneralSecurityException
IOException
DocumentException
public static void signDeferred(PdfReader reader, String fieldName, OutputStream outs, ExternalSignatureContainer externalSignatureContainer) throws DocumentException, IOException, GeneralSecurityException
reader
- the original PDF
fieldName
- the field to sign. It must be the last field
outs
- the output PDF
externalSignatureContainer
- the signature container doing the actual signing. Only the method ExternalSignatureContainer.sign is used
DocumentException
IOException
GeneralSecurityException
Copyright © 1998–2019. All rights reserved.