com.itextpdf.text.pdf.security
Class MakeSignature

java.lang.Object
  extended by com.itextpdf.text.pdf.security.MakeSignature

public class MakeSignature
extends Object

Class that signs your PDF.

Author:
Paulo Soares

Field Summary
static boolean CADES
          Parameter to indicate that you want to sign using CMS Advanced Electronic Signatures.
static boolean CMS
          Parameter to indicate that you want to sign using the Cryptographic Message Syntax.
 
Constructor Summary
MakeSignature()
           
 
Method Summary
static Collection<byte[]> processCrl(Certificate cert, Collection<CrlClient> crlList)
          Processes a CRL list.
static void signDetached(PdfSignatureAppearance sap, ExternalSignature externalSignature, Certificate[] chain, Collection<CrlClient> crlList, OcspClient ocspClient, TSAClient tsaClient, String provider, int estimatedSize, boolean cades)
          Signs the document using the detached mode, CMS or CAdES equivalent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CMS

public static final boolean CMS
Parameter to indicate that you want to sign using the Cryptographic Message Syntax.

See Also:
Constant Field Values

CADES

public static final boolean CADES
Parameter to indicate that you want to sign using CMS Advanced Electronic Signatures.

See Also:
Constant Field Values
Constructor Detail

MakeSignature

public MakeSignature()
Method Detail

signDetached

public static void signDetached(PdfSignatureAppearance sap,
                                ExternalSignature externalSignature,
                                Certificate[] chain,
                                Collection<CrlClient> crlList,
                                OcspClient ocspClient,
                                TSAClient tsaClient,
                                String provider,
                                int estimatedSize,
                                boolean cades)
                         throws IOException,
                                DocumentException,
                                GeneralSecurityException
Signs the document using the detached mode, CMS or CAdES equivalent.

Parameters:
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
provider - the provider or null
estimatedSize - the reserved size for the signature. It will be estimated if 0
cades - true to sign CAdES equivalent PAdES-BES, false to sign CMS
Throws:
DocumentException
IOException
GeneralSecurityException
NoSuchAlgorithmException
Exception

processCrl

public static Collection<byte[]> processCrl(Certificate cert,
                                            Collection<CrlClient> crlList)
Processes a CRL list.

Parameters:
cert - a Certificate if one of the CrlList implementations needs to retrieve the CRL URL from it.
crlList - a list of CrlClient implementations
Returns:
a collection of CRL bytes that can be embedded in a PDF.


Copyright © 2012. All Rights Reserved.