Java Doc for AcroFields.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.AcroFields

AcroFields
public class AcroFields (Code)
Query and change fields in existing documents either by method calls or by FDF merging.
author:
   Paulo Soares (psoares@consiste.pt)

Inner Class :public static class Item

Field Summary
final public static  intDA_COLOR
    
final public static  intDA_FONT
    
final public static  intDA_SIZE
    
final public static  intFIELD_TYPE_CHECKBOX
     A field type.
final public static  intFIELD_TYPE_COMBO
     A field type.
final public static  intFIELD_TYPE_LIST
     A field type.
final public static  intFIELD_TYPE_NONE
     A field type invalid or not found.
final public static  intFIELD_TYPE_PUSHBUTTON
     A field type.
final public static  intFIELD_TYPE_RADIOBUTTON
     A field type.
final public static  intFIELD_TYPE_SIGNATURE
     A field type.
final public static  intFIELD_TYPE_TEXT
     A field type.
 HashMapfields
    
 PdfReaderreader
    
 PdfWriterwriter
    

Constructor Summary
 AcroFields(PdfReader reader, PdfWriter writer)
    

Method Summary
public  voidaddSubstitutionFont(BaseFont font)
     Adds a substitution font to the list.
public  voiddecodeGenericDictionary(PdfDictionary merged, BaseField tx)
    
public  voidexportAsFdf(FdfWriter writer)
     Export the fields as a FDF.
public  InputStreamextractRevision(String field)
     Extracts a revision from the document.
Parameters:
  field - the signature field name an InputStream covering the revision.
 voidfill()
    
 PdfAppearancegetAppearance(PdfDictionary merged, String text, String fieldName)
    
public  String[]getAppearanceStates(String fieldName)
     Gets the list of appearance names.
public  ArrayListgetBlankSignatureNames()
     Gets the field names that have blank signatures.
public  StringgetField(String name)
     Gets the field value.
public  HashMapgetFieldCache()
     Gets the appearances cache.
public  ItemgetFieldItem(String name)
     Gets the field structure.
public  float[]getFieldPositions(String name)
     Gets the field box positions in the document.
public  intgetFieldType(String fieldName)
     Gets the field type.
public  HashMapgetFields()
     Gets all the fields.
public  String[]getListOptionDisplay(String fieldName)
     Gets the list of display option values from fields of type list or combo.
public  String[]getListOptionExport(String fieldName)
     Gets the list of export option values from fields of type list or combo.
 ColorgetMKColor(PdfArray ar)
    
public  PushbuttonFieldgetNewPushbuttonFromField(String field)
     Creates a new pushbutton from an existing field.
public  intgetRevision(String field)
     Gets this field revision.
public  PdfDictionarygetSignatureDictionary(String name)
     Gets the signature dictionary, the one keyed by /V.
public  ArrayListgetSignatureNames()
     Gets the field names that have signatures and are signed.
public  ArrayListgetSubstitutionFonts()
     Gets the list of substitution fonts.
public  intgetTotalRevisions()
     Gets the total number of revisions this document has.
public  StringgetTranslatedFieldName(String name)
     Gets the long XFA translated name.
public  XfaFormgetXfa()
     Gets the XFA form processor.
public  booleanisGenerateAppearances()
     Gets the property generateAppearances.
 booleanisInAP(PdfDictionary dic, PdfName check)
    
public  voidmergeXfaData(Node n)
     Merges an XML data structure into this form.
public  booleanregenerateField(String name)
     Regenerates the field appearance.
public  booleanremoveField(String name, int page)
     Removes a field from the document.
public  booleanremoveField(String name)
     Removes a field from the document.
public  booleanremoveFieldsFromPage(int page)
     Removes all the fields from page.
public  booleanrenameField(String oldName, String newName)
     Renames a field.
public  booleanreplacePushbuttonField(String field, PdfFormField button)
     Replaces the field with a new pushbutton.
public  voidsetExtraMargin(float extraMarginLeft, float extraMarginTop)
     Sets extra margins in text fields to better mimic the Acrobat layout.
public  booleansetField(String name, String value)
     Sets the field value.
public  booleansetField(String name, String value, String display)
     Sets the field value and the display string.
public  voidsetFieldCache(HashMap fieldCache)
     Sets a cache for field appearances.
public  booleansetFieldProperty(String field, String name, Object value, int inst)
     Sets a field property.
public  booleansetFieldProperty(String field, String name, int value, int inst)
     Sets a field property.
public  voidsetFields(FdfReader fdf)
     Sets the fields by FDF merging.
public  voidsetFields(XfdfReader xfdf)
     Sets the fields by XFDF merging.
public  voidsetGenerateAppearances(boolean generateAppearances)
     Sets the option to generate appearances.
public  booleansetListOption(String fieldName, String[] exportValues, String[] displayValues)
     Sets the option list for fields of type list or combo.
public  voidsetSubstitutionFonts(ArrayList substitutionFonts)
     Sets a list of substitution fonts.
public  booleansignatureCoversWholeDocument(String name)
     Checks is the signature covers the entire document or just part of it.
public static  Object[]splitDAelements(String da)
    
public  PdfPKCS7verifySignature(String name)
     Verifies a signature.
public  PdfPKCS7verifySignature(String name, String provider)
     Verifies a signature.

Field Detail
DA_COLOR
final public static int DA_COLOR(Code)



DA_FONT
final public static int DA_FONT(Code)



DA_SIZE
final public static int DA_SIZE(Code)



FIELD_TYPE_CHECKBOX
final public static int FIELD_TYPE_CHECKBOX(Code)
A field type.



FIELD_TYPE_COMBO
final public static int FIELD_TYPE_COMBO(Code)
A field type.



FIELD_TYPE_LIST
final public static int FIELD_TYPE_LIST(Code)
A field type.



FIELD_TYPE_NONE
final public static int FIELD_TYPE_NONE(Code)
A field type invalid or not found.



FIELD_TYPE_PUSHBUTTON
final public static int FIELD_TYPE_PUSHBUTTON(Code)
A field type.



FIELD_TYPE_RADIOBUTTON
final public static int FIELD_TYPE_RADIOBUTTON(Code)
A field type.



FIELD_TYPE_SIGNATURE
final public static int FIELD_TYPE_SIGNATURE(Code)
A field type.



FIELD_TYPE_TEXT
final public static int FIELD_TYPE_TEXT(Code)
A field type.



fields
HashMap fields(Code)



reader
PdfReader reader(Code)



writer
PdfWriter writer(Code)




Constructor Detail
AcroFields
AcroFields(PdfReader reader, PdfWriter writer)(Code)




Method Detail
addSubstitutionFont
public void addSubstitutionFont(BaseFont font)(Code)
Adds a substitution font to the list. The fonts in this list will be used if the original font doesn't contain the needed glyphs.
Parameters:
  font - the font



decodeGenericDictionary
public void decodeGenericDictionary(PdfDictionary merged, BaseField tx) throws IOException, DocumentException(Code)



exportAsFdf
public void exportAsFdf(FdfWriter writer)(Code)
Export the fields as a FDF.
Parameters:
  writer - the FDF writer



extractRevision
public InputStream extractRevision(String field) throws IOException(Code)
Extracts a revision from the document.
Parameters:
  field - the signature field name an InputStream covering the revision. Returns null ifit's not a signature field
throws:
  IOException - on error



fill
void fill()(Code)



getAppearance
PdfAppearance getAppearance(PdfDictionary merged, String text, String fieldName) throws IOException, DocumentException(Code)



getAppearanceStates
public String[] getAppearanceStates(String fieldName)(Code)
Gets the list of appearance names. Use it to get the names allowed with radio and checkbox fields. If the /Opt key exists the values will also be included. The name 'Off' may also be valid even if not returned in the list.
Parameters:
  fieldName - the fully qualified field name the list of names or null if the field does not exist



getBlankSignatureNames
public ArrayList getBlankSignatureNames()(Code)
Gets the field names that have blank signatures. the field names that have blank signatures



getField
public String getField(String name)(Code)
Gets the field value.
Parameters:
  name - the fully qualified field name the field value



getFieldCache
public HashMap getFieldCache()(Code)
Gets the appearances cache. the appearances cache



getFieldItem
public Item getFieldItem(String name)(Code)
Gets the field structure.
Parameters:
  name - the name of the field the field structure or null if the fielddoes not exist



getFieldPositions
public float[] getFieldPositions(String name)(Code)
Gets the field box positions in the document. The return is an array of float multiple of 5. For each of this groups the values are: [page, llx, lly, urx, ury]. The coordinates have the page rotation in consideration.
Parameters:
  name - the field name the positions or null if field does not exist



getFieldType
public int getFieldType(String fieldName)(Code)
Gets the field type. The type can be one of: FIELD_TYPE_PUSHBUTTON, FIELD_TYPE_CHECKBOX, FIELD_TYPE_RADIOBUTTON, FIELD_TYPE_TEXT, FIELD_TYPE_LIST, FIELD_TYPE_COMBO or FIELD_TYPE_SIGNATURE.

If the field does not exist or is invalid it returns FIELD_TYPE_NONE.
Parameters:
  fieldName - the field name the field type




getFields
public HashMap getFields()(Code)
Gets all the fields. The fields are keyed by the fully qualified field name and the value is an instance of AcroFields.Item. all the fields



getListOptionDisplay
public String[] getListOptionDisplay(String fieldName)(Code)
Gets the list of display option values from fields of type list or combo. If the field doesn't exist or the field type is not list or combo it will return null.
Parameters:
  fieldName - the field name the list of export option values from fields of type list or combo



getListOptionExport
public String[] getListOptionExport(String fieldName)(Code)
Gets the list of export option values from fields of type list or combo. If the field doesn't exist or the field type is not list or combo it will return null.
Parameters:
  fieldName - the field name the list of export option values from fields of type list or combo



getMKColor
Color getMKColor(PdfArray ar)(Code)



getNewPushbuttonFromField
public PushbuttonField getNewPushbuttonFromField(String field)(Code)
Creates a new pushbutton from an existing field. This pushbutton can be changed and be used to replace an existing one, with the same name or other name, as long is it is in the same document. To replace an existing pushbutton call AcroFields.replacePushbuttonField(String,PdfFormField) .
Parameters:
  field - the field name that should be a pushbutton a new pushbutton or null if the field is not a pushbutton



getRevision
public int getRevision(String field)(Code)
Gets this field revision.
Parameters:
  field - the signature field name the revision or zero if it's not a signature field



getSignatureDictionary
public PdfDictionary getSignatureDictionary(String name)(Code)
Gets the signature dictionary, the one keyed by /V.
Parameters:
  name - the field name the signature dictionary keyed by /V or null if the field is nota signature



getSignatureNames
public ArrayList getSignatureNames()(Code)
Gets the field names that have signatures and are signed. the field names that have signatures and are signed



getSubstitutionFonts
public ArrayList getSubstitutionFonts()(Code)
Gets the list of substitution fonts. The list is composed of BaseFont and can be null. The fonts in this list will be used if the original font doesn't contain the needed glyphs. the list



getTotalRevisions
public int getTotalRevisions()(Code)
Gets the total number of revisions this document has. the total number of revisions



getTranslatedFieldName
public String getTranslatedFieldName(String name)(Code)
Gets the long XFA translated name.
Parameters:
  name - the name of the field the long field name



getXfa
public XfaForm getXfa()(Code)
Gets the XFA form processor. the XFA form processor



isGenerateAppearances
public boolean isGenerateAppearances()(Code)
Gets the property generateAppearances. the property generateAppearances



isInAP
boolean isInAP(PdfDictionary dic, PdfName check)(Code)



mergeXfaData
public void mergeXfaData(Node n) throws IOException, DocumentException(Code)
Merges an XML data structure into this form.
Parameters:
  n - the top node of the data structure
throws:
  java.io.IOException - on error
throws:
  com.lowagie.text.DocumentException - o error



regenerateField
public boolean regenerateField(String name) throws IOException, DocumentException(Code)
Regenerates the field appearance. This is usefull when you change a field property, but not its value, for instance form.setFieldProperty("f", "bgcolor", Color.BLUE, null); This won't have any effect, unless you use regenerateField("f") after changing the property.
Parameters:
  name - the fully qualified field name or the partial name in the case of XFA forms
throws:
  IOException - on error
throws:
  DocumentException - on error true if the field was found and changed,false otherwise



removeField
public boolean removeField(String name, int page)(Code)
Removes a field from the document. If page equals -1 all the fields with this name are removed from the document otherwise only the fields in that particular page are removed.
Parameters:
  name - the field name
Parameters:
  page - the page to remove the field from or -1 to remove it from all the pages true if the field exists, false otherwise



removeField
public boolean removeField(String name)(Code)
Removes a field from the document.
Parameters:
  name - the field name true if the field exists, false otherwise



removeFieldsFromPage
public boolean removeFieldsFromPage(int page)(Code)
Removes all the fields from page.
Parameters:
  page - the page to remove the fields from true if any field was removed, false otherwise



renameField
public boolean renameField(String oldName, String newName)(Code)
Renames a field. Only the last part of the name can be renamed. For example, if the original field is "ab.cd.ef" only the "ef" part can be renamed.
Parameters:
  oldName - the old field name
Parameters:
  newName - the new field name true if the renaming was successful, falseotherwise



replacePushbuttonField
public boolean replacePushbuttonField(String field, PdfFormField button)(Code)
Replaces the field with a new pushbutton. The pushbutton can be created with AcroFields.getNewPushbuttonFromField(String) from the same document or it can be a generic PdfFormField of the type pushbutton.
Parameters:
  field - the field name
Parameters:
  button - the PdfFormField representing the pushbutton true if the field was replaced, false if the fieldwas not a pushbutton



setExtraMargin
public void setExtraMargin(float extraMarginLeft, float extraMarginTop)(Code)
Sets extra margins in text fields to better mimic the Acrobat layout.
Parameters:
  extraMarginLeft - the extra marging left
Parameters:
  extraMarginTop - the extra margin top



setField
public boolean setField(String name, String value) throws IOException, DocumentException(Code)
Sets the field value.
Parameters:
  name - the fully qualified field name or the partial name in the case of XFA forms
Parameters:
  value - the field value
throws:
  IOException - on error
throws:
  DocumentException - on error true if the field was found and changed,false otherwise



setField
public boolean setField(String name, String value, String display) throws IOException, DocumentException(Code)
Sets the field value and the display string. The display string is used to build the appearance in the cases where the value is modified by Acrobat with JavaScript and the algorithm is known.
Parameters:
  name - the fully qualified field name or the partial name in the case of XFA forms
Parameters:
  value - the field value
Parameters:
  display - the string that is used for the appearance. If nullthe value parameter will be used true if the field was found and changed,false otherwise
throws:
  IOException - on error
throws:
  DocumentException - on error



setFieldCache
public void setFieldCache(HashMap fieldCache)(Code)
Sets a cache for field appearances. Parsing the existing PDF to create a new TextField is time expensive. For those tasks that repeatedly fill the same PDF with different field values the use of the cache has dramatic speed advantages. An example usage:

 String pdfFile = ...;// the pdf file used as template
 ArrayList xfdfFiles = ...;// the xfdf file names
 ArrayList pdfOutFiles = ...;// the output file names, one for each element in xpdfFiles
 HashMap cache = new HashMap();// the appearances cache
 PdfReader originalReader = new PdfReader(pdfFile);
 for (int k = 0; k < xfdfFiles.size(); ++k) {
 PdfReader reader = new PdfReader(originalReader);
 XfdfReader xfdf = new XfdfReader((String)xfdfFiles.get(k));
 PdfStamper stp = new PdfStamper(reader, new FileOutputStream((String)pdfOutFiles.get(k)));
 AcroFields af = stp.getAcroFields();
 af.setFieldCache(cache);
 af.setFields(xfdf);
 stp.close();
 }
 

Parameters:
  fieldCache - an HasMap that will carry the cached appearances



setFieldProperty
public boolean setFieldProperty(String field, String name, Object value, int inst)(Code)
Sets a field property. Valid property names are:

  • textfont - sets the text font. The value for this entry is a BaseFont.
  • textcolor - sets the text color. The value for this entry is a java.awt.Color.
  • textsize - sets the text size. The value for this entry is a Float.
  • bgcolor - sets the background color. The value for this entry is a java.awt.Color. If null removes the background.
  • bordercolor - sets the border color. The value for this entry is a java.awt.Color. If null removes the border.

Parameters:
  field - the field name
Parameters:
  name - the property name
Parameters:
  value - the property value
Parameters:
  inst - an array of int indexing into AcroField.Item.merged elements to process.Set to null to process all true if the property exists, false otherwise



setFieldProperty
public boolean setFieldProperty(String field, String name, int value, int inst)(Code)
Sets a field property. Valid property names are:

  • flags - a set of flags specifying various characteristics of the field's widget annotation. The value of this entry replaces that of the F entry in the form's corresponding annotation dictionary.
  • setflags - a set of flags to be set (turned on) in the F entry of the form's corresponding widget annotation dictionary. Bits equal to 1 cause the corresponding bits in F to be set to 1.
  • clrflags - a set of flags to be cleared (turned off) in the F entry of the form's corresponding widget annotation dictionary. Bits equal to 1 cause the corresponding bits in F to be set to 0.
  • fflags - a set of flags specifying various characteristics of the field. The value of this entry replaces that of the Ff entry in the form's corresponding field dictionary.
  • setfflags - a set of flags to be set (turned on) in the Ff entry of the form's corresponding field dictionary. Bits equal to 1 cause the corresponding bits in Ff to be set to 1.
  • clrfflags - a set of flags to be cleared (turned off) in the Ff entry of the form's corresponding field dictionary. Bits equal to 1 cause the corresponding bits in Ff to be set to 0.

Parameters:
  field - the field name
Parameters:
  name - the property name
Parameters:
  value - the property value
Parameters:
  inst - an array of int indexing into AcroField.Item.merged elements to process.Set to null to process all true if the property exists, false otherwise



setFields
public void setFields(FdfReader fdf) throws IOException, DocumentException(Code)
Sets the fields by FDF merging.
Parameters:
  fdf - the FDF form
throws:
  IOException - on error
throws:
  DocumentException - on error



setFields
public void setFields(XfdfReader xfdf) throws IOException, DocumentException(Code)
Sets the fields by XFDF merging.
Parameters:
  xfdf - the XFDF form
throws:
  IOException - on error
throws:
  DocumentException - on error



setGenerateAppearances
public void setGenerateAppearances(boolean generateAppearances)(Code)
Sets the option to generate appearances. Not generating apperances will speed-up form filling but the results can be unexpected in Acrobat. Don't use it unless your environment is well controlled. The default is true.
Parameters:
  generateAppearances - the option to generate appearances



setListOption
public boolean setListOption(String fieldName, String[] exportValues, String[] displayValues)(Code)
Sets the option list for fields of type list or combo. One of exportValues or displayValues may be null but not both. This method will only set the list but will not set the value or appearance. For that, calling setField() is required.

An example:

 PdfReader pdf = new PdfReader("input.pdf");
 PdfStamper stp = new PdfStamper(pdf, new FileOutputStream("output.pdf"));
 AcroFields af = stp.getAcroFields();
 af.setListOption("ComboBox", new String[]{"a", "b", "c"}, new String[]{"first", "second", "third"});
 af.setField("ComboBox", "b");
 stp.close();
 

Parameters:
  fieldName - the field name
Parameters:
  exportValues - the export values
Parameters:
  displayValues - the display values true if the operation succeeded, false otherwise



setSubstitutionFonts
public void setSubstitutionFonts(ArrayList substitutionFonts)(Code)
Sets a list of substitution fonts. The list is composed of BaseFont and can also be null. The fonts in this list will be used if the original font doesn't contain the needed glyphs.
Parameters:
  substitutionFonts - the list



signatureCoversWholeDocument
public boolean signatureCoversWholeDocument(String name)(Code)
Checks is the signature covers the entire document or just part of it.
Parameters:
  name - the signature field name true if the signature covers the entire document,false otherwise



splitDAelements
public static Object[] splitDAelements(String da)(Code)



verifySignature
public PdfPKCS7 verifySignature(String name)(Code)
Verifies a signature. An example usage is:

 KeyStore kall = PdfPKCS7.loadCacertsKeyStore();
 PdfReader reader = new PdfReader("my_signed_doc.pdf");
 AcroFields af = reader.getAcroFields();
 ArrayList names = af.getSignatureNames();
 for (int k = 0; k < names.size(); ++k) {
 String name = (String)names.get(k);
 System.out.println("Signature name: " + name);
 System.out.println("Signature covers whole document: " + af.signatureCoversWholeDocument(name));
 PdfPKCS7 pk = af.verifySignature(name);
 Calendar cal = pk.getSignDate();
 Certificate pkc[] = pk.getCertificates();
 System.out.println("Subject: " + PdfPKCS7.getSubjectFields(pk.getSigningCertificate()));
 System.out.println("Document modified: " + !pk.verify());
 Object fails[] = PdfPKCS7.verifyCertificates(pkc, kall, null, cal);
 if (fails == null)
 System.out.println("Certificates verified against the KeyStore");
 else
 System.out.println("Certificate failed: " + fails[1]);
 }
 

Parameters:
  name - the signature field name a PdfPKCS7 class to continue the verification



verifySignature
public PdfPKCS7 verifySignature(String name, String provider)(Code)
Verifies a signature. An example usage is:

 KeyStore kall = PdfPKCS7.loadCacertsKeyStore();
 PdfReader reader = new PdfReader("my_signed_doc.pdf");
 AcroFields af = reader.getAcroFields();
 ArrayList names = af.getSignatureNames();
 for (int k = 0; k < names.size(); ++k) {
 String name = (String)names.get(k);
 System.out.println("Signature name: " + name);
 System.out.println("Signature covers whole document: " + af.signatureCoversWholeDocument(name));
 PdfPKCS7 pk = af.verifySignature(name);
 Calendar cal = pk.getSignDate();
 Certificate pkc[] = pk.getCertificates();
 System.out.println("Subject: " + PdfPKCS7.getSubjectFields(pk.getSigningCertificate()));
 System.out.println("Document modified: " + !pk.verify());
 Object fails[] = PdfPKCS7.verifyCertificates(pkc, kall, null, cal);
 if (fails == null)
 System.out.println("Certificates verified against the KeyStore");
 else
 System.out.println("Certificate failed: " + fails[1]);
 }
 

Parameters:
  name - the signature field name
Parameters:
  provider - the provider or null for the default provider a PdfPKCS7 class to continue the verification



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.