com.qoppa.pdf
Class SignatureSettings

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

public class SignatureSettings
extends Object

This class manages the certificates that are used to verify digital signatures.

Author:
Qoppa Software

Method Summary
static void addKeyStore(KeyStore keystore)
          Adds any X509 certificates found in a key store to the trusted certificate list to be used when verifying digital signatures.
static void addX509Certificate(X509Certificate certificate)
          Adds a X509 certificate to the trusted certificate list to be used when verifying digital signatures.
static Hashtable getTrustedCertificates()
          This method returns a hashtable of trusted certificates keyed by the unique identifier of the X509Certificate that is returned from SignatureSettings.getUniqueIdentifier(X509Certificate)
static String getUniqueIdentifier(X509Certificate certificate)
          Returns a unique identifier for a certificate.
static void reloadTrustedCertificates()
          This method clears the trusted certificate list and reloads the trusted certificates if the CaCertsEnabled flag is enabled.
static void setCaCertsEnabled(boolean enabled)
          The CaCertsEnabled flag determines whether or not the certificates in cacerts from the current JRE will be added to the trusted certificate cache used to verify digital signatures.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setCaCertsEnabled

public static void setCaCertsEnabled(boolean enabled)
The CaCertsEnabled flag determines whether or not the certificates in cacerts from the current JRE will be added to the trusted certificate cache used to verify digital signatures. Changing the value of this flag will cause the certificates to be reloaded.

Parameters:
enabled - New value of the flag

addX509Certificate

public static void addX509Certificate(X509Certificate certificate)
Adds a X509 certificate to the trusted certificate list to be used when verifying digital signatures. If certificates need to be removed from the trusted certificate list, reload the trusted certificates.

Parameters:
certificate - the certificate to add to the trusted certificate list

addKeyStore

public static void addKeyStore(KeyStore keystore)
                        throws KeyStoreException
Adds any X509 certificates found in a key store to the trusted certificate list to be used when verifying digital signatures. If certificates need to be removed from the trusted certificate cache, reload the trusted certificates.

Parameters:
keystore - The key store object holding the certificates that will be added to the trusted list.
Throws:
KeyStoreException

reloadTrustedCertificates

public static void reloadTrustedCertificates()
This method clears the trusted certificate list and reloads the trusted certificates if the CaCertsEnabled flag is enabled.


getTrustedCertificates

public static Hashtable getTrustedCertificates()
This method returns a hashtable of trusted certificates keyed by the unique identifier of the X509Certificate that is returned from SignatureSettings.getUniqueIdentifier(X509Certificate)

Returns:
Hashtable The trusted certificate table keyed by the unique identifier of the X509Certificate

getUniqueIdentifier

public static String getUniqueIdentifier(X509Certificate certificate)
Returns a unique identifier for a certificate.

Parameters:
certificate -
Returns:
unique identifier for a certificate