|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectPdfObjectContainer
com.crionics.jpdf.forms.AbstractField
com.crionics.jpdf.forms.SignatureField
public class SignatureField
Representation of a signature form field. This class contains all the methods to validate and sign PDF Signatures fields.
| Method Summary | |
|---|---|
void |
addDuplicatedAppearance(int pageindex,
java.awt.Point position)
This method can be used to duplicate the Visual appearance of the signature on any pages of the current Document Instance. |
static SignatureField |
createInstance(PdfDocument doc,
java.lang.String name)
Create a Invisible Signature in the specified document. |
static SignatureField |
createInstance(PdfDocument doc,
java.lang.String name,
int pageIndex,
java.awt.Rectangle rect)
Create a Blank Signature in the specified document. |
java.security.cert.X509Certificate[] |
getCertificateChain()
Returns the certificate chain. |
java.lang.String |
getContactInfo()
Returns the signer's contact information, empty if not set |
byte[] |
getDigest()
Returns the signature digest, result of the signature calculation. |
java.io.InputStream |
getInputStream()
Returns an inputstrean on the data part of the signature calculation. |
java.lang.String |
getLocation()
Returns the signer's location, empty if not set |
java.lang.String |
getReason()
Returns the signer's reason to sign the document, empty if not set |
java.lang.String |
getSignerName()
Returns the name of the signer, empty if not set |
boolean |
isBlank()
returns true if the signature has never been signed. |
boolean |
isLocked()
returns true if the signature is locked and cannot be changed. |
void |
setReason(java.lang.String reason)
As described in the PDF spec, |
void |
setSignatureAppearance(SignatureAppearance app)
Sets the Object which will be used to construct the visual appearance of the Signature Form Field in the document after being signed. |
void |
sign(CustomSigner signer)
Signs an existing signature field using the given custom signer. |
void |
sign(java.security.PrivateKey privateKey,
java.security.cert.Certificate[] chain)
Signs an existing signature field using the given private key and certification chain. |
ValidationResults |
validate()
Validates the signature using the default validators: The byterange validity is checked to certify that the signature covers the whole documents (excluding the signature content). |
| Methods inherited from class com.crionics.jpdf.forms.AbstractField |
|---|
getAssociatedPageIndex, getBorderColor, getBorderStyle, getBorderWidth, getFillColor, getName, getOrientation, getPosition, getTextColor, getTextFont, getTextSize, getToolTip, isHidden, isPrintable, isReadOnly, setBorderColor, setBorderStyle, setBorderWidth, setFillColor, setHidden, setOrientation, setPosition, setPrintable, setReadOnly, setTextColor, setTextFont, setTextFont, setTextSize, setToolTip |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static SignatureField createInstance(PdfDocument doc,
java.lang.String name)
throws PdfException,
java.io.IOException
doc - The Document where the Signature should be created.name - The Name of the Signature Form Field.
PdfException - If a problem occurred while parsing the document.
java.io.IOException - If a problem occurred while parsing the file.
public static SignatureField createInstance(PdfDocument doc,
java.lang.String name,
int pageIndex,
java.awt.Rectangle rect)
throws PdfException,
java.io.IOException
doc - The Document where the Signature should be created.name - The Name of the Signature Form Field.pageIndex - The Index of the page where the Form Field should be created.rect - The Position and Size of the Form Field on the specified page.
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.
public void addDuplicatedAppearance(int pageindex,
java.awt.Point position)
throws java.io.IOException,
PdfException
pageindex - The index of the page where the Visual Appearance should be
addedposition - The Top Left Coordinate of the Signature Visual Appearance in
reference to the Top Left corner of the requested page.
PdfException - If a problem occurred while parsing the document.
java.io.IOException - If a problem occurred while parsing the file.
public java.security.cert.X509Certificate[] getCertificateChain()
throws PdfException,
java.io.IOException
PdfException - io issue
java.io.IOException - pdf related issue
public java.lang.String getContactInfo()
throws java.io.IOException,
PdfException
java.io.IOException - io problem
PdfException - if signature is blank
public byte[] getDigest()
throws PdfException,
java.io.IOException
PdfException - pdf related exception
PdfSignatureException - pdf errors more specific to signature generation
java.io.IOException - io/cache issues
public java.io.InputStream getInputStream()
throws PdfException,
java.io.IOException
PdfException - io issue
java.io.IOException - pdf related issue
public java.lang.String getLocation()
throws java.io.IOException,
PdfException
java.io.IOException - io problem
PdfException - if signature is blank
public java.lang.String getReason()
throws java.io.IOException,
PdfException
java.io.IOException - io problem
PdfException - if signature is blank
public java.lang.String getSignerName()
throws java.io.IOException,
PdfException
java.io.IOException - io problem
PdfException - if signature is blank
public boolean isBlank()
throws PdfException,
java.io.IOException
java.io.IOException - io issue
PdfException - pdf related issue
public boolean isLocked()
throws PdfException,
java.io.IOException
java.io.IOException - io issue
PdfException - pdf related issue
public void setReason(java.lang.String reason)
throws java.io.IOException,
PdfException
reason - the reason to sign this document
java.io.IOException - io issue
PdfException - pdf related issue
public void setSignatureAppearance(SignatureAppearance app)
throws java.io.IOException,
PdfException
app - The appearance setup to use.
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.
public void sign(CustomSigner signer)
throws PdfException,
java.io.IOException
signer -
PdfException - if the signature is locked
java.io.IOException - io/cache issues
public void sign(java.security.PrivateKey privateKey,
java.security.cert.Certificate[] chain)
throws PdfException,
java.io.IOException
privateKey - private key used to sign this documentchain - certification path associated with the private key
PdfException - if the signature is locked
java.io.IOException
public ValidationResults validate()
throws java.io.IOException,
PdfException
java.io.IOException - io issue
PdfException - if the signature is blank or pending
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||