Java Doc for PdfSignatureAppearance.java in  » PDF » pdf-itext » com » lowagie » text » pdf » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » PDF » pdf itext » com.lowagie.text.pdf 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.lowagie.text.pdf.PdfSignatureAppearance

PdfSignatureAppearance
public class PdfSignatureAppearance (Code)
This class takes care of the cryptographic options and appearances that form a signature.

Inner Class :public interface SignatureEvent

Field Summary
final public static  intCERTIFIED_FORM_FILLING
    
final public static  intCERTIFIED_FORM_FILLING_AND_ANNOTATIONS
    
final public static  intCERTIFIED_NO_CHANGES_ALLOWED
    
final public static  intNOT_CERTIFIED
    
final public static  PdfNameSELF_SIGNED
     The self signed filter.
final public static  intSignatureRenderDescription
    
final public static  intSignatureRenderGraphicAndDescription
    
final public static  intSignatureRenderNameAndDescription
    
final public static  PdfNameVERISIGN_SIGNED
     The VeriSign filter.
final public static  PdfNameWINCER_SIGNED
     The Windows Certificate Security.
final public static  StringquestionMark
    

Constructor Summary
 PdfSignatureAppearance(PdfStamperImp writer)
    

Method Summary
public  voidclose(PdfDictionary update)
     This is the last method to be called when using external signatures.
public static  floatfitText(Font font, String text, Rectangle rect, float maxFontSize, int runDirection)
     Fits the text to some rectangle adjusting the font size as needed.
public  PdfTemplategetAppearance()
     Gets the main appearance layer.
public  java.security.cert.Certificate[]getCertChain()
     Gets the certificate chain.
public  intgetCertificationLevel()
     Gets the certified status of this document.
public  StringgetContact()
     Gets the signing contact.
public  java.security.cert.CRL[]getCrlList()
     Gets the certificate revocation list.
public  com.lowagie.text.pdf.PdfDictionarygetCryptoDictionary()
     Gets the user made signature dictionary.
public  java.lang.StringgetFieldName()
     Gets the field name.
public  com.lowagie.text.pdf.PdfNamegetFilter()
     Gets the filter used to sign the document.
public  ImagegetImage()
     Gets the background image for the layer 2.
public  floatgetImageScale()
     Gets the scaling to be applied to the background image.
public  PdfTemplategetLayer(int layer)
     Gets a template layer to create a signature appearance.
public  FontgetLayer2Font()
     Gets the n2 and n4 layer font.
public  StringgetLayer2Text()
     Gets the signature text identifying the signer if set by setLayer2Text().
public  StringgetLayer4Text()
     Gets the text identifying the signature status if set by setLayer4Text().
public  StringgetLocation()
     Gets the signing location.
public  StringgetNewSigName()
     Gets a new signature fied name that doesn't clash with any existing name.
 java.io.OutputStreamgetOriginalout()
    
public  intgetPage()
     Gets the page number of the field.
public  com.lowagie.text.RectanglegetPageRect()
     Gets the rectangle that represent the position and dimension of the signature in the page.
public  java.security.PrivateKeygetPrivKey()
     Gets the private key.
public  StringgetProvider()
     Returns the Cryptographic Service Provider that will sign the document.
public  InputStreamgetRangeStream()
     Gets the document bytes that are hashable when using external signatures.
public  StringgetReason()
     Gets the signing reason.
public  RectanglegetRect()
     Gets the rectangle representing the signature dimensions. the rectangle representing the signature dimensions.
public  intgetRender()
     Gets the rendering mode for this signature.
public  intgetRunDirection()
     Gets the run direction.
public  com.lowagie.text.pdf.PdfSigGenericPKCSgetSigStandard()
     Gets the instance of the standard signature dictionary.
public  java.util.CalendargetSignDate()
     Gets the signature date.
public  SignatureEventgetSignatureEvent()
     Getter for property signatureEvent.
public  ImagegetSignatureGraphic()
     Gets the Image object to render.
 com.lowagie.text.pdf.ByteBuffergetSigout()
    
public  com.lowagie.text.pdf.PdfStampergetStamper()
     Gets the PdfStamper associated with this instance.
public  java.io.FilegetTempFile()
     Gets the temporary file.
public  PdfTemplategetTopLayer()
     Gets the template that aggregates all appearance layers.
public  booleanisAcro6Layers()
     Gets the Acrobat 6.0 layer mode.
public  booleanisInvisible()
     Gets the visibility status of the signature.
public  booleanisNewField()
     Checks if a new field was created.
public  booleanisPreClosed()
     Checks if the document is in the process of closing.
public  voidpreClose()
     This is the first method to be called when using external signatures.
public  voidpreClose(HashMap exclusionSizes)
     This is the first method to be called when using external signatures.
public  voidsetAcro6Layers(boolean acro6Layers)
     Acrobat 6.0 and higher recomends that only layer n2 and n4 be present.
public  voidsetCertificationLevel(int certificationLevel)
     Sets the document type to certified instead of simply signed.
public  voidsetContact(String contact)
     Sets the signing contact.
public  voidsetCrypto(PrivateKey privKey, Certificate[] certChain, CRL[] crlList, PdfName filter)
     Sets the cryptographic parameters.
Parameters:
  privKey - the private key
Parameters:
  certChain - the certificate chain
Parameters:
  crlList - the certificate revocation list.
public  voidsetCryptoDictionary(com.lowagie.text.pdf.PdfDictionary cryptoDictionary)
     Sets a user made signature dictionary.
public  voidsetExternalDigest(byte digest, byte RSAdata, String digestEncryptionAlgorithm)
     Sets the digest/signature to an external calculated value.
Parameters:
  digest - the digest.
public  voidsetImage(Image image)
     Sets the background image for the layer 2.
public  voidsetImageScale(float imageScale)
     Sets the scaling to be applied to the background image.
public  voidsetLayer2Font(Font layer2Font)
     Sets the n2 and n4 layer font.
public  voidsetLayer2Text(String text)
     Sets the signature text identifying the signer.
Parameters:
  text - the signature text identifying the signer.
public  voidsetLayer4Text(String text)
     Sets the text identifying the signature status.
Parameters:
  text - the text identifying the signature status.
public  voidsetLocation(String location)
     Sets the signing location.
 voidsetOriginalout(java.io.OutputStream originalout)
    
public  voidsetProvider(String provider)
     Sets the Cryptographic Service Provider that will sign the document.
public  voidsetReason(String reason)
     Sets the signing reason.
public  voidsetRender(int render)
     Sets the rendering mode for this signature.
public  voidsetRunDirection(int runDirection)
     Sets the run direction in the n2 and n4 layer.
public  voidsetSignDate(java.util.Calendar signDate)
     Sets the signature date.
public  voidsetSignatureEvent(SignatureEvent signatureEvent)
     Sets the signature event to allow modification of the signature dictionary.
public  voidsetSignatureGraphic(Image signatureGraphic)
     Sets the Image object to render when Render is set to SignatureRenderGraphicAndDescription
Parameters:
  signatureGraphic - image rendered.
 voidsetSigout(com.lowagie.text.pdf.ByteBuffer sigout)
    
 voidsetStamper(com.lowagie.text.pdf.PdfStamper stamper)
    
 voidsetTempFile(java.io.File tempFile)
    
public  voidsetVisibleSignature(Rectangle pageRect, int page, String fieldName)
     Sets the signature to be visible.
public  voidsetVisibleSignature(String fieldName)
     Sets the signature to be visible.

Field Detail
CERTIFIED_FORM_FILLING
final public static int CERTIFIED_FORM_FILLING(Code)



CERTIFIED_FORM_FILLING_AND_ANNOTATIONS
final public static int CERTIFIED_FORM_FILLING_AND_ANNOTATIONS(Code)



CERTIFIED_NO_CHANGES_ALLOWED
final public static int CERTIFIED_NO_CHANGES_ALLOWED(Code)



NOT_CERTIFIED
final public static int NOT_CERTIFIED(Code)



SELF_SIGNED
final public static PdfName SELF_SIGNED(Code)
The self signed filter.



SignatureRenderDescription
final public static int SignatureRenderDescription(Code)
The rendering mode is just the description



SignatureRenderGraphicAndDescription
final public static int SignatureRenderGraphicAndDescription(Code)
The rendering mode is an image and the description



SignatureRenderNameAndDescription
final public static int SignatureRenderNameAndDescription(Code)
The rendering mode is the name of the signer and the description



VERISIGN_SIGNED
final public static PdfName VERISIGN_SIGNED(Code)
The VeriSign filter.



WINCER_SIGNED
final public static PdfName WINCER_SIGNED(Code)
The Windows Certificate Security.



questionMark
final public static String questionMark(Code)
Commands to draw a yellow question mark in a stream content




Constructor Detail
PdfSignatureAppearance
PdfSignatureAppearance(PdfStamperImp writer)(Code)




Method Detail
close
public void close(PdfDictionary update) throws IOException, DocumentException(Code)
This is the last method to be called when using external signatures. The general sequence is: preClose(), getDocumentBytes() and close().

update is a PdfDictionary that must have exactly the same keys as the ones provided in PdfSignatureAppearance.preClose(HashMap) .
Parameters:
  update - a PdfDictionary with the key/value that will fill the holes definedin PdfSignatureAppearance.preClose(HashMap)
throws:
  DocumentException - on error
throws:
  IOException - on error




fitText
public static float fitText(Font font, String text, Rectangle rect, float maxFontSize, int runDirection)(Code)
Fits the text to some rectangle adjusting the font size as needed.
Parameters:
  font - the font to use
Parameters:
  text - the text
Parameters:
  rect - the rectangle where the text must fit
Parameters:
  maxFontSize - the maximum font size
Parameters:
  runDirection - the run direction the calculated font size that makes the text fit



getAppearance
public PdfTemplate getAppearance() throws DocumentException(Code)
Gets the main appearance layer.

Consult PPKAppearances.pdf for further details. the main appearance layer
throws:
  DocumentException - on error




getCertChain
public java.security.cert.Certificate[] getCertChain()(Code)
Gets the certificate chain. the certificate chain



getCertificationLevel
public int getCertificationLevel()(Code)
Gets the certified status of this document. the certified status



getContact
public String getContact()(Code)
Gets the signing contact. the signing contact



getCrlList
public java.security.cert.CRL[] getCrlList()(Code)
Gets the certificate revocation list. the certificate revocation list



getCryptoDictionary
public com.lowagie.text.pdf.PdfDictionary getCryptoDictionary()(Code)
Gets the user made signature dictionary. This is the dictionary at the /V key. the user made signature dictionary



getFieldName
public java.lang.String getFieldName()(Code)
Gets the field name. the field name



getFilter
public com.lowagie.text.pdf.PdfName getFilter()(Code)
Gets the filter used to sign the document. the filter used to sign the document



getImage
public Image getImage()(Code)
Gets the background image for the layer 2. the background image for the layer 2



getImageScale
public float getImageScale()(Code)
Gets the scaling to be applied to the background image. the scaling to be applied to the background image



getLayer
public PdfTemplate getLayer(int layer)(Code)
Gets a template layer to create a signature appearance. The layers can go from 0 to 4.

Consult PPKAppearances.pdf for further details.
Parameters:
  layer - the layer a template




getLayer2Font
public Font getLayer2Font()(Code)
Gets the n2 and n4 layer font. the n2 and n4 layer font



getLayer2Text
public String getLayer2Text()(Code)
Gets the signature text identifying the signer if set by setLayer2Text(). the signature text identifying the signer



getLayer4Text
public String getLayer4Text()(Code)
Gets the text identifying the signature status if set by setLayer4Text(). the text identifying the signature status



getLocation
public String getLocation()(Code)
Gets the signing location. the signing location



getNewSigName
public String getNewSigName()(Code)
Gets a new signature fied name that doesn't clash with any existing name. a new signature fied name



getOriginalout
java.io.OutputStream getOriginalout()(Code)



getPage
public int getPage()(Code)
Gets the page number of the field. the page number of the field



getPageRect
public com.lowagie.text.Rectangle getPageRect()(Code)
Gets the rectangle that represent the position and dimension of the signature in the page. the rectangle that represent the position and dimension of the signature in the page



getPrivKey
public java.security.PrivateKey getPrivKey()(Code)
Gets the private key. the private key



getProvider
public String getProvider()(Code)
Returns the Cryptographic Service Provider that will sign the document. provider the name of the provider, for example "SUN",or null to use the default provider.



getRangeStream
public InputStream getRangeStream()(Code)
Gets the document bytes that are hashable when using external signatures. The general sequence is: preClose(), getRangeStream() and close().

the document bytes that are hashable




getReason
public String getReason()(Code)
Gets the signing reason. the signing reason



getRect
public Rectangle getRect()(Code)
Gets the rectangle representing the signature dimensions. the rectangle representing the signature dimensions. It may be nullor have zero width or height for invisible signatures



getRender
public int getRender()(Code)
Gets the rendering mode for this signature. the rendering mode for this signature



getRunDirection
public int getRunDirection()(Code)
Gets the run direction. the run direction



getSigStandard
public com.lowagie.text.pdf.PdfSigGenericPKCS getSigStandard()(Code)
Gets the instance of the standard signature dictionary. This instance is only available after pre close.

The main use is to insert external signatures. the instance of the standard signature dictionary




getSignDate
public java.util.Calendar getSignDate()(Code)
Gets the signature date. the signature date



getSignatureEvent
public SignatureEvent getSignatureEvent()(Code)
Getter for property signatureEvent. Value of property signatureEvent.



getSignatureGraphic
public Image getSignatureGraphic()(Code)
Gets the Image object to render. the image



getSigout
com.lowagie.text.pdf.ByteBuffer getSigout()(Code)



getStamper
public com.lowagie.text.pdf.PdfStamper getStamper()(Code)
Gets the PdfStamper associated with this instance. the PdfStamper associated with this instance



getTempFile
public java.io.File getTempFile()(Code)
Gets the temporary file. the temporary file or null is the document is created in memory



getTopLayer
public PdfTemplate getTopLayer()(Code)
Gets the template that aggregates all appearance layers. This corresponds to the /FRM resource.

Consult PPKAppearances.pdf for further details. the template that aggregates all appearance layers




isAcro6Layers
public boolean isAcro6Layers()(Code)
Gets the Acrobat 6.0 layer mode. the Acrobat 6.0 layer mode



isInvisible
public boolean isInvisible()(Code)
Gets the visibility status of the signature. the visibility status of the signature



isNewField
public boolean isNewField()(Code)
Checks if a new field was created. true if a new field was created, false if signingan existing field or if the signature is invisible



isPreClosed
public boolean isPreClosed()(Code)
Checks if the document is in the process of closing. true if the document is in the process of closing,false otherwise



preClose
public void preClose() throws IOException, DocumentException(Code)
This is the first method to be called when using external signatures. The general sequence is: preClose(), getDocumentBytes() and close().

If calling preClose() dont't call PdfStamper.close().

No external signatures are allowed if this methos is called.
throws:
  IOException - on error
throws:
  DocumentException - on error




preClose
public void preClose(HashMap exclusionSizes) throws IOException, DocumentException(Code)
This is the first method to be called when using external signatures. The general sequence is: preClose(), getDocumentBytes() and close().

If calling preClose() dont't call PdfStamper.close().

If using an external signature exclusionSizes must contain at least the PdfName.CONTENTS key with the size that it will take in the document. Note that due to the hex string coding this size should be byte_size*2+2.
Parameters:
  exclusionSizes - a HashMap with names and sizes to be excluded in the signaturecalculation. The key is a PdfName and the value anInteger. At least the PdfName.CONTENTS must be present
throws:
  IOException - on error
throws:
  DocumentException - on error




setAcro6Layers
public void setAcro6Layers(boolean acro6Layers)(Code)
Acrobat 6.0 and higher recomends that only layer n2 and n4 be present. This method sets that mode.
Parameters:
  acro6Layers - if true only the layers n2 and n4 will be present



setCertificationLevel
public void setCertificationLevel(int certificationLevel)(Code)
Sets the document type to certified instead of simply signed.
Parameters:
  certificationLevel - the values can be: NOT_CERTIFIED, CERTIFIED_NO_CHANGES_ALLOWED,CERTIFIED_FORM_FILLING and CERTIFIED_FORM_FILLING_AND_ANNOTATIONS



setContact
public void setContact(String contact)(Code)
Sets the signing contact.
Parameters:
  contact - the signing contact



setCrypto
public void setCrypto(PrivateKey privKey, Certificate[] certChain, CRL[] crlList, PdfName filter)(Code)
Sets the cryptographic parameters.
Parameters:
  privKey - the private key
Parameters:
  certChain - the certificate chain
Parameters:
  crlList - the certificate revocation list. It may be null
Parameters:
  filter - the crytographic filter type. It can be SELF_SIGNED, VERISIGN_SIGNED or WINCER_SIGNED



setCryptoDictionary
public void setCryptoDictionary(com.lowagie.text.pdf.PdfDictionary cryptoDictionary)(Code)
Sets a user made signature dictionary. This is the dictionary at the /V key.
Parameters:
  cryptoDictionary - a user made signature dictionary



setExternalDigest
public void setExternalDigest(byte digest, byte RSAdata, String digestEncryptionAlgorithm)(Code)
Sets the digest/signature to an external calculated value.
Parameters:
  digest - the digest. This is the actual signature
Parameters:
  RSAdata - the extra data that goes into the data tag in PKCS#7
Parameters:
  digestEncryptionAlgorithm - the encryption algorithm. It may must be null if the digestis also null. If the digest is not nullthen it may be "RSA" or "DSA"



setImage
public void setImage(Image image)(Code)
Sets the background image for the layer 2.
Parameters:
  image - the background image for the layer 2



setImageScale
public void setImageScale(float imageScale)(Code)
Sets the scaling to be applied to the background image. If it's zero the image will fully fill the rectangle. If it's less than zero the image will fill the rectangle but will keep the proportions. If it's greater than zero that scaling will be applied. In any of the cases the image will always be centered. It's zero by default.
Parameters:
  imageScale - the scaling to be applied to the background image



setLayer2Font
public void setLayer2Font(Font layer2Font)(Code)
Sets the n2 and n4 layer font. If the font size is zero, auto-fit will be used.
Parameters:
  layer2Font - the n2 and n4 font



setLayer2Text
public void setLayer2Text(String text)(Code)
Sets the signature text identifying the signer.
Parameters:
  text - the signature text identifying the signer. If null or not seta standard description will be used



setLayer4Text
public void setLayer4Text(String text)(Code)
Sets the text identifying the signature status.
Parameters:
  text - the text identifying the signature status. If null or not setthe description "Signature Not Verified" will be used



setLocation
public void setLocation(String location)(Code)
Sets the signing location.
Parameters:
  location - the signing location



setOriginalout
void setOriginalout(java.io.OutputStream originalout)(Code)



setProvider
public void setProvider(String provider)(Code)
Sets the Cryptographic Service Provider that will sign the document.
Parameters:
  provider - the name of the provider, for example "SUN", ornull to use the default provider.



setReason
public void setReason(String reason)(Code)
Sets the signing reason.
Parameters:
  reason - the signing reason



setRender
public void setRender(int render)(Code)
Sets the rendering mode for this signature. The rendering modes can be the constants SignatureRenderDescription, SignatureRenderNameAndDescription or SignatureRenderGraphicAndDescription. The two last modes should be used with Acrobat 6 layer type.
Parameters:
  render - the render mode



setRunDirection
public void setRunDirection(int runDirection)(Code)
Sets the run direction in the n2 and n4 layer.
Parameters:
  runDirection - the run direction



setSignDate
public void setSignDate(java.util.Calendar signDate)(Code)
Sets the signature date.
Parameters:
  signDate - the signature date



setSignatureEvent
public void setSignatureEvent(SignatureEvent signatureEvent)(Code)
Sets the signature event to allow modification of the signature dictionary.
Parameters:
  signatureEvent - the signature event



setSignatureGraphic
public void setSignatureGraphic(Image signatureGraphic)(Code)
Sets the Image object to render when Render is set to SignatureRenderGraphicAndDescription
Parameters:
  signatureGraphic - image rendered. If null the mode is defaultedto SignatureRenderDescription



setSigout
void setSigout(com.lowagie.text.pdf.ByteBuffer sigout)(Code)



setStamper
void setStamper(com.lowagie.text.pdf.PdfStamper stamper)(Code)



setTempFile
void setTempFile(java.io.File tempFile)(Code)



setVisibleSignature
public void setVisibleSignature(Rectangle pageRect, int page, String fieldName)(Code)
Sets the signature to be visible. It creates a new visible signature field.
Parameters:
  pageRect - the position and dimension of the field in the page
Parameters:
  page - the page to place the field. The fist page is 1
Parameters:
  fieldName - the field name or null to generate automatically a new field name



setVisibleSignature
public void setVisibleSignature(String fieldName)(Code)
Sets the signature to be visible. An empty signature field with the same name must already exist.
Parameters:
  fieldName - the existing empty signature field name



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.