Class DefaultSignatureExtension

java.lang.Object
org.faceless.publisher.ext.DefaultSignatureExtension
All Implemented Interfaces:
ReportFactoryExtension, SignatureExtension
Direct Known Subclasses:
GlobalSignSignatureExtension

public class DefaultSignatureExtension extends Object implements SignatureExtension

The DefaultSignatureExtension handles the signing process for PDF digital signatures with an engine of "default" (which is the default value if the "engine" param is not specified).

Other engine types should subclass this to avoid doing more work than is necessary

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    apply(org.faceless.publisher.type.FormSignatureResource resource, FormSignature field)
    Sign the signature
    static void
    applyBasics(org.faceless.publisher.type.FormSignatureResource resource, FormSignature field)
    Apply universal properties to the signature.
    void
    applyTSA(org.faceless.publisher.type.FormSignatureResource resource, AcrobatSignatureHandlerFactory factory)
    Apply the time-stamp property "tsa" to the signature
    org.faceless.publisher.type.KeyStoreAuthorization
    getKeyStoreAuthorization(org.faceless.publisher.type.FormSignatureResource resource)
    Given the "keystore", "alias", "password", "store-password", "serial", "cn" and "dn" parameters, return a .
    static final String
    getParameter(org.faceless.publisher.type.FormSignatureResource resource, String key)
    Return the specified parameter, which will be taken from the support FormSignatureResource if present, or the report environment for this type of signature if not.
    void
    prepare(org.faceless.publisher.type.FormSignatureResource resource)
    If this object returned true from supports(org.faceless.publisher.type.FormSignatureResource), this method is called to prepare the signature.
    boolean
    supports(org.faceless.publisher.type.FormSignatureResource resource)
    Return true if this SignatureExtension supports the specified Signature type.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.faceless.publisher.ext.ReportFactoryExtension

    configure, load, register, register, unregister, unregister
  • Constructor Details

    • DefaultSignatureExtension

      public DefaultSignatureExtension()
  • Method Details

    • supports

      public boolean supports(org.faceless.publisher.type.FormSignatureResource resource)
      Return true if this SignatureExtension supports the specified Signature type. Subclassses should override this and test for resource.getParameter("engine")
      Specified by:
      supports in interface SignatureExtension
    • prepare

      public void prepare(org.faceless.publisher.type.FormSignatureResource resource)
      If this object returned true from supports(org.faceless.publisher.type.FormSignatureResource), this method is called to prepare the signature. This may involve validating, setting default attributes etc.
      Specified by:
      prepare in interface SignatureExtension
    • applyBasics

      public static void applyBasics(org.faceless.publisher.type.FormSignatureResource resource, FormSignature field)
      Apply universal properties to the signature. This will use the description and the "reason", "author", "contact-info", "location", "changes" and "attestation" parameters on the signature. This method should generally be called by all SignatureExtension implementations.
      Parameters:
      resource - the signature resource
      field - the field
    • applyTSA

      public void applyTSA(org.faceless.publisher.type.FormSignatureResource resource, AcrobatSignatureHandlerFactory factory) throws MalformedURLException
      Apply the time-stamp property "tsa" to the signature
      Parameters:
      resource - the signature resource
      factory - the factory
      Throws:
      MalformedURLException
    • getParameter

      public static final String getParameter(org.faceless.publisher.type.FormSignatureResource resource, String key)
      Return the specified parameter, which will be taken from the support FormSignatureResource if present, or the report environment for this type of signature if not.
    • getKeyStoreAuthorization

      public org.faceless.publisher.type.KeyStoreAuthorization getKeyStoreAuthorization(org.faceless.publisher.type.FormSignatureResource resource)
      Given the "keystore", "alias", "password", "store-password", "serial", "cn" and "dn" parameters, return a . If none is available this method returns null.
    • apply

      public void apply(org.faceless.publisher.type.FormSignatureResource resource, FormSignature field) throws GeneralSecurityException, IOException
      Sign the signature
      Specified by:
      apply in interface SignatureExtension
      Throws:
      GeneralSecurityException
      IOException