org.faceless.pdf2.viewer2.feature
Class FormSignedSignatureWidgetFactory

java.lang.Object
  extended by org.faceless.pdf2.viewer2.ViewerFeature
      extended by org.faceless.pdf2.viewer2.AnnotationComponentFactory
          extended by org.faceless.pdf2.viewer2.feature.FormSignedSignatureWidgetFactory

public class FormSignedSignatureWidgetFactory
extends AnnotationComponentFactory

Create annotations to handle WidgetAnnotation objects belonging to signed FormSignature fields. As supplied, this class will verify signatures against certificates found in the KeyStore returned from FormSignature.loadDefaultKeyStore(), but it's possible to create an instance of this factory that verifies against a KeyStore passed in to setKeyStoreManager(). Then just remove the default FormSignedSignatureWidgetFactory from the features passed in to the PDFViewer constructor and replace it with that new instance. The name of this feature is "FormSignedSignatureWidgetFactory".

This code is copyright the Big Faceless Organization. You're welcome to use, modify and distribute it in any form in your own projects, provided those projects continue to make use of the Big Faceless PDF library.

Since:
2.8

Nested Class Summary
 class FormSignedSignatureWidgetFactory.SignatureState
          A SignatureState contains information about a Signature once it's been verified.
 
Constructor Summary
FormSignedSignatureWidgetFactory()
          Create a new FormSignedSignatureWidgetFactory that verifies against the default KeyStore.
 
Method Summary
 JComponent createComponent(PagePanel pagepanel, PDFAnnotation annot)
          Return a JComponent that will visually represent the specified PDFAnnotation.
 void displaySignatureState(FormSignedSignatureWidgetFactory.SignatureState state, DocumentPanel docpanel)
          Display a popup dialog that displays information about the SignatureState
 Icon getIcon(FormSignedSignatureWidgetFactory.SignatureState state)
          Return an Icon that visually represents the state of the signature.
 void initialize(PDFViewer viewer)
          Called when the feature is first added to a viewer
 boolean matches(PDFAnnotation annot)
          Return true if this AnnotationComponentFactory could create a JComponent for the specified PDFAnnotation.
 void setKeyStoreManager(KeyStoreManager manager)
          Set the KeyStoreManager that signatures should be verified against
 FormSignedSignatureWidgetFactory.SignatureState validate(FormSignature sig)
          Validate the Signature and return it's validation state.
 
Methods inherited from class org.faceless.pdf2.viewer2.AnnotationComponentFactory
bindComponentLocation, bindComponentLocation, bindComponentLocation, createEditComponent, createNewAnnotation, getAnnotationType, paintComponent, toString
 
Methods inherited from class org.faceless.pdf2.viewer2.ViewerFeature
getAllFeatures, getCustomJavaScript, getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FormSignedSignatureWidgetFactory

public FormSignedSignatureWidgetFactory()
Create a new FormSignedSignatureWidgetFactory that verifies against the default KeyStore.

Method Detail

initialize

public void initialize(PDFViewer viewer)
Description copied from class: ViewerFeature
Called when the feature is first added to a viewer

Overrides:
initialize in class ViewerFeature

matches

public boolean matches(PDFAnnotation annot)
Description copied from class: AnnotationComponentFactory
Return true if this AnnotationComponentFactory could create a JComponent for the specified PDFAnnotation.

Specified by:
matches in class AnnotationComponentFactory

createComponent

public JComponent createComponent(PagePanel pagepanel,
                                  PDFAnnotation annot)
Description copied from class: AnnotationComponentFactory
Return a JComponent that will visually represent the specified PDFAnnotation.

Specified by:
createComponent in class AnnotationComponentFactory
Parameters:
pagepanel - the panel the JComponent will be added to
annot - the annotation

setKeyStoreManager

public void setKeyStoreManager(KeyStoreManager manager)
Set the KeyStoreManager that signatures should be verified against

Parameters:
manager - the keystore
Since:
2.8.3

validate

public FormSignedSignatureWidgetFactory.SignatureState validate(FormSignature sig)
Validate the Signature and return it's validation state.


displaySignatureState

public void displaySignatureState(FormSignedSignatureWidgetFactory.SignatureState state,
                                  DocumentPanel docpanel)
Display a popup dialog that displays information about the SignatureState

Parameters:
state - the SignatureState to display information on
docpanel - the Component to display the dialog in

getIcon

public Icon getIcon(FormSignedSignatureWidgetFactory.SignatureState state)
Return an Icon that visually represents the state of the signature. This will be displayed in the document and in the Popup used by displaySignatureState()

Parameters:
state - the state


Copyright © 2001-2008 Big Faceless Organization