com.qoppa.pdf
Class SigningInformation

java.lang.Object
  extended bycom.qoppa.pdf.SigningInformation

public class SigningInformation
extends Object

Object that holds information necessary to digitally sign a PDF file. This object is normally used by the host application to set the information that the library needs to sign a PDF file.

Author:
Qoppa Software

Constructor Summary
SigningInformation(KeyStore ks, String entryAlias, String aliasPWD)
          Constructs a SigningInformation object and gets the digital ID from a Java KeyStore object.
SigningInformation(String pkcs12File, String ksPWD, String entryAlias, String aliasPWD)
          Constructs a SigningInformation object and gets the digital ID from a named PKCS#12 file.
 
Method Summary
 Certificate[] getCertificateChain()
          Returns the certificate chain for the issuers of the certificate in the key store.
 String getContactInformation()
          Returns the contact information used in the signature.
 String getLocation()
          Gets the location to be used in the signature.
 PrivateKey getPrivateKey()
          Returns the private key retrieved from the KeyStore or PKCS #12 file.
 String getReason()
          Gets the reason for signing to be used in the signature.
 SignatureAppearance getSignatureAppearance()
          Returns the SignatureAppearance to use when creating the signature appearance stream.
 Certificate getSignerCertificate()
          Returns the certificate for the digital id retrieved from the KeyStore or the PKCS#12 file.
 void setContactInformation(String contactInformation)
          Sets the contact information to be used in the signature.
 void setLocation(String location)
          Sets the location to be used in the signature.
 void setReason(String reason)
          Sets the reason for signing to be used in the signature.
 void setSignatureAppearance(SignatureAppearance signAppearance)
          Sets the SignatureAppearance to use when creating the signature appearance stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SigningInformation

public SigningInformation(String pkcs12File,
                          String ksPWD,
                          String entryAlias,
                          String aliasPWD)
                   throws GeneralSecurityException,
                          IOException,
                          PDFException
Constructs a SigningInformation object and gets the digital ID from a named PKCS#12 file. The method reads the file and gets the digital ID for use in signing.

Parameters:
pkcs12File - The name of the PKCS#12 key store file
ksPWD - The key store password
entryAlias - The alias of the entry to be used in signing.
aliasPWD - The password to the alias entry.
Throws:
GeneralSecurityException
IOException
PDFException

SigningInformation

public SigningInformation(KeyStore ks,
                          String entryAlias,
                          String aliasPWD)
                   throws GeneralSecurityException,
                          PDFException
Constructs a SigningInformation object and gets the digital ID from a Java KeyStore object.

Parameters:
ks - The KeyStore object that contains the digital ID.
entryAlias - The alias of the entry to be used in signing.
aliasPWD - The password to the alias entry.
Throws:
GeneralSecurityException
PDFException
Method Detail

getContactInformation

public String getContactInformation()
Returns the contact information used in the signature.

Returns:
The contact name

setContactInformation

public void setContactInformation(String contactInformation)
Sets the contact information to be used in the signature.

Parameters:
contactInformation - The new contact information.

getLocation

public String getLocation()
Gets the location to be used in the signature.

Returns:
The location

setLocation

public void setLocation(String location)
Sets the location to be used in the signature.

Parameters:
location - The new location.

getReason

public String getReason()
Gets the reason for signing to be used in the signature.

Returns:
The reason for signing.

setReason

public void setReason(String reason)
Sets the reason for signing to be used in the signature.

Parameters:
reason - The new reason.

getPrivateKey

public PrivateKey getPrivateKey()
Returns the private key retrieved from the KeyStore or PKCS #12 file. This key is used to create the digital signature hash when a document is signed.

Returns:
The private key.

getSignerCertificate

public Certificate getSignerCertificate()
Returns the certificate for the digital id retrieved from the KeyStore or the PKCS#12 file.

Returns:
The certificate for the digital id.

getCertificateChain

public Certificate[] getCertificateChain()
Returns the certificate chain for the issuers of the certificate in the key store.

Returns:
The certificate chain.

setSignatureAppearance

public void setSignatureAppearance(SignatureAppearance signAppearance)
Sets the SignatureAppearance to use when creating the signature appearance stream.

Parameters:
signAppearance - the signAppearance to use when creating the signature appearance stream

getSignatureAppearance

public SignatureAppearance getSignatureAppearance()
Returns the SignatureAppearance to use when creating the signature appearance stream.

Returns:
the signAppearance