public abstract class Signature extends Object
An abstract class which represents signature object in the pdf document. Signatures are fields with values of signature objects, the last contain data which is used to verify the document validity.
Constructor and Description |
---|
Signature()
Inititalizes new instance of the
Signature class. |
Signature(com.aspose.ms.System.IO.Stream pfx,
String password)
Inititalizes new instance of the
Signature class. |
Signature(String pfx,
String password)
Inititalizes new instance of the
Signature class. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Destructor which closes temporary streams (if necessary).
|
String |
getAuthority()
The name of the person or authority signing the document.
|
int[] |
getByteRange()
An array of pairs of integers (starting byte offset, length in bytes)
that shall describe the exact byte range for the digest calculation.
|
String |
getContactInfo()
Information provided by the signer to enable a recipient to contact the signer
to verify the signature, e.g.
|
com.aspose.ms.System.DateTime |
getDate()
The time of signing.
|
String |
getLocation()
The CPU host name or physical location of the signing.
|
String |
getReason()
The reason for the signing, such as (I agree…).
|
boolean |
getShowProperties()
Force to show/hide signature properties.
|
void |
setAuthority(String value) |
void |
setContactInfo(String value) |
void |
setDate(com.aspose.ms.System.DateTime value) |
void |
setImage(InputStream _image) |
void |
setLocation(String value) |
void |
setReason(String value) |
void |
setShowProperties(boolean value) |
boolean |
verify()
Verify the document regarding this signature and return true if document is valid
or otherwise false.
|
public Signature()
Inititalizes new instance of the Signature
class.
public Signature(String pfx, String password)
Inititalizes new instance of the Signature
class.
pfx
- Pfx file which contains certificate for signing.password
- Password to get access to the private key in the certificate.public Signature(com.aspose.ms.System.IO.Stream pfx, String password)
Inititalizes new instance of the Signature
class.
pfx
- Stream with certificate data organized as pfx.password
- Password to get access to the private key in the certificate.public void setImage(InputStream _image)
public String getAuthority()
The name of the person or authority signing the document.
public void setAuthority(String value)
public com.aspose.ms.System.DateTime getDate()
The time of signing.
public void setDate(com.aspose.ms.System.DateTime value)
public String getLocation()
The CPU host name or physical location of the signing.
public void setLocation(String value)
public String getReason()
The reason for the signing, such as (I agree…).
public void setReason(String value)
public String getContactInfo()
Information provided by the signer to enable a recipient to contact the signer to verify the signature, e.g. a phone number.
public void setContactInfo(String value)
public int[] getByteRange()
An array of pairs of integers (starting byte offset, length in bytes) that shall describe the exact byte range for the digest calculation.
public boolean verify()
Verify the document regarding this signature and return true if document is valid or otherwise false.
public boolean getShowProperties()
Force to show/hide signature properties. In case ShowProperties is true signature field has predefined format of appearance (strings to represent): ------------------------------------------- Digitally signed by {certificate subject} Date: {signature.Date} Reason: {signature.Reason} Location: {signature.Location} ------------------------------------------- where {X} is placeholder for X value. Also signature can have image, in this case listed strings are placed over image. ShowProperties is true by default.
public void setShowProperties(boolean value)
public void close()
Destructor which closes temporary streams (if necessary).
Copyright © 2020 Aspose. All Rights Reserved.