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(InputStream 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()
Get array of pairs of integers (starting byte offset, length in bytes) that shall describe
the exact byte range for the digest calculation.
|
String |
getContactInfo()
Get information provided by the signer to enable a recipient to contact the signer to verify
the signature, e.g. a phone number.
|
SignatureCustomAppearance |
getCustomAppearance()
Gets/sets the custom appearance.
|
Date |
getDate()
Gets the time of signing.
|
com.aspose.ms.System.IO.Stream |
getImageInternal()
Gets image stream.
|
String |
getLocation()
Gets the CPU host name or physical location of the signing.
|
String |
getReason()
Gets the reason for the signing, such as (I agree…).
|
List<com.aspose.pdf.engine.security.impl.signatures.SignatureReference> |
getSignatureReferences()
get Signature References
|
TimestampSettings |
getTimestampSettings()
Gets timestamp settings.
|
boolean |
isShowProperties()
Force to show/hide signature properties.
|
void |
setAuthority(String value)
Sets the name of the person or authority signing the document.
|
void |
setContactInfo(String value)
Set information provided by the signer to enable a recipient to contact the signer to verify
the signature, e.g. a phone number.
|
void |
setCustomAppearance(SignatureCustomAppearance value)
Gets/sets the custom appearance.
|
void |
setDate(Date value)
Set the time of signing.
|
void |
setImage(InputStream _signatureAppearanceStream)
Sets image stream.
|
void |
setImageInternal(com.aspose.ms.System.IO.Stream value) |
void |
setLocation(String value)
Sets the CPU host name or physical location of the signing.
|
void |
setReason(String value)
Sets the reason for the signing, such as (I agree…).
|
void |
setShowProperties(boolean value)
Force to show/hide signature properties.
|
void |
setTimestampSettings(TimestampSettings value)
Sets timestamp settings.
|
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(InputStream 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 final SignatureCustomAppearance getCustomAppearance()
Gets/sets the custom appearance.
public final void setCustomAppearance(SignatureCustomAppearance value)
Gets/sets the custom appearance.
value
- SignatureCustomAppearance instancepublic final String getAuthority()
The name of the person or authority signing the document.
public void setAuthority(String value)
Sets the name of the person or authority signing the document.
value
- String valuepublic Date getDate()
Gets the time of signing.
public void setDate(Date value)
Set the time of signing.
value
- Date objectpublic String getLocation()
Gets the CPU host name or physical location of the signing.
public void setLocation(String value)
Sets the CPU host name or physical location of the signing.
value
- String valuepublic String getReason()
Gets the reason for the signing, such as (I agree…).
public void setReason(String value)
Sets the reason for the signing, such as (I agree…).
value
- String valuepublic String getContactInfo()
Get 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)
Set information provided by the signer to enable a recipient to contact the signer to verify the signature, e.g. a phone number.
value
- String valuepublic int[] getByteRange()
Get array of pairs of integers (starting byte offset, length in bytes) that shall describe the exact byte range for the digest calculation.
public TimestampSettings getTimestampSettings()
public void setTimestampSettings(TimestampSettings value)
value
- TimestampSettingspublic com.aspose.ms.System.IO.Stream getImageInternal()
Gets image stream.
For internal only usagepublic void setImage(InputStream _signatureAppearanceStream)
Sets image stream.
_signatureAppearanceStream
- Steam objectpublic void setImageInternal(com.aspose.ms.System.IO.Stream value)
public List<com.aspose.pdf.engine.security.impl.signatures.SignatureReference> getSignatureReferences()
java.util.List<SignatureReference> object
public boolean verify()
Verify the document regarding this signature and return true if document is valid or otherwise false.
public boolean isShowProperties()
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)
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.
value
- boolean valuepublic void close()
Destructor which closes temporary streams (if necessary).