public final class PdfFileSignature extends SaveableFacade
Represents a class to sign a pdf file with a certificate.
Constructor and Description |
---|
PdfFileSignature()
The constructor of PdfFileSignature class.
|
PdfFileSignature(IDocument document)
Initializes new
PdfFileSignature object on base of the document . |
PdfFileSignature(IDocument document,
String outputFile)
Deprecated.
|
PdfFileSignature(String inputFile)
Deprecated.
|
PdfFileSignature(String inputFile,
String outputFile)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
bindPdf(InputStream inputStream)
Binds a Pdf stream for editing.
|
void |
bindPdf(String inputFile)
Binds a Pdf file for editing.
|
void |
certify(int page,
String SigReason,
String SigContact,
String SigLocation,
boolean visible,
Rectangle annotRect,
DocMDPSignature docMdpSignature)
Certify the document with the MDP signature.
|
void |
certify(String sigName,
DocMDPSignature docMdpSignature)
Certify the document with the MDP signature which is placed in already presented signature field.
|
void |
close()
Closes the facade.
|
boolean |
containsSignature()
Checks if the pdf has a digital signature or not.
|
boolean |
containsUsageRights()
Checks if the pdf has a usage rights or not.
|
boolean |
coversWholeDocument(SignatureName signName)
Checks if the signature covers the whole document.
|
boolean |
coversWholeDocument(String signName)
Deprecated.
CoversWholeDocument(SignatureName) should be used instead.
|
void |
dispose()
Deprecated.
|
InputStream |
extractCertificate(SignatureName signName)
Extracts signature's single X.509 certificate as a stream.
|
InputStream |
extractCertificate(String signName)
Extracts signature's single X.509 certificate as a stream.
|
InputStream |
extractImage(SignatureName signName)
Extracts signature's image.
|
InputStream |
extractImage(String signName)
Deprecated.
Use ExtractImage(SignatureName) method instead.
|
DocMDPAccessPermissions |
getAccessPermissions()
Returns the access permissions value of certified document by the MDP signature type.
|
List<String> |
getBlankSignNames()
Deprecated.
Use GetBlankSignatureNames() instead.
|
String |
getContactInfo(SignatureName signName)
Gets the contact information of a signature.
|
String |
getContactInfo(String signName)
Deprecated.
Use GetContactInfo(SignatureName) instead.
|
Date |
getDateTime(SignatureName signName)
Gets the signature's datetime.
|
Date |
getDateTime(String signName)
Deprecated.
Use GetDateTime(SignatureName) instead.
|
String |
getLocation(SignatureName signName)
Gets the location of a signature.
|
String |
getLocation(String signName)
Deprecated.
Use GetLocation(SignatureName) instead.
|
String |
getReason(SignatureName signName)
Gets the reason of a signature.
|
String |
getReason(String signName)
Deprecated.
Use GetReason(SignatureName) instead.
|
int |
getRevision(SignatureName signName)
Gets the revision of a signature.
|
int |
getRevision(String signName)
Deprecated.
GetRevision(SignatureName) should be used instead of GetRevision(string).
|
String |
getSignatureAppearance()
Gets a graphic appearance for the signature.
|
InputStream |
getSignatureAppearanceStream()
Gets a graphic appearance for the signature.
|
com.aspose.ms.System.Collections.Generic.IGenericList<SignatureName> |
getSignatureNames()
Gets the names of all not empty signatures.
|
com.aspose.ms.System.Collections.Generic.IGenericList<SignatureName> |
getSignatureNames(boolean onlyActive)
Gets the names of all not empty signatures.
|
List<com.aspose.pdf.engine.security.SignatureAlgorithmInfo> |
getSignaturesInfo()
Retrieves information about all signatures algorithm present in the PDF document.
|
String |
getSignerName(SignatureName signName)
Gets the name of person or organization who signing the pdf document.
|
String |
getSignerName(String signName)
Deprecated.
Use GetSignerName(SignatureName) instead.
|
List<String> |
getSignNames()
Gets the names of all not empty signatures.
|
List<String> |
getSignNames(boolean onlyActive)
Deprecated.
The method can produce the same signature names, which cannot be distinguished during verification. Use getSignatureNames(boolean onlyActive) instead.
|
int |
getTotalRevision()
Gets the toltal revision.
|
boolean |
isCertified()
Gets the flag determining whether a document is certified or not.
|
boolean |
isContainSignature()
Deprecated.
|
boolean |
isCoversWholeDocument(String signName)
Deprecated.
CoversWholeDocument(SignatureName) should be used instead.
|
boolean |
isLtvEnabled()
Gets the LTV enabled flag.
|
void |
removeSignature(SignatureName signName)
Remove the signature according to the name of the signature.
|
void |
removeSignature(SignatureName signName,
boolean removeField)
Removes the signature according to the name of the signature.
|
void |
removeSignature(String signName)
Deprecated.
Use RemoveSignature(SignatureName) instead.
|
void |
removeSignature(String signName,
boolean removeField)
Deprecated.
Use RemoveSignature(SignatureName, bool) instead.
|
void |
removeSignatures()
Removes all signatures.
|
void |
removeUsageRights()
Removes the usage rights entry.
|
void |
save()
Deprecated.
|
void |
save(OutputStream outputStream)
Saves the result PDF to stream.
|
void |
save(String outputFile)
Saves the result PDF to file.
|
void |
setCertificate(String pfx,
String pass)
Set certificate file and password for signing routine.
|
void |
setSignatureAppearance(String value)
Sets a graphic appearance for the signature.
|
void |
setSignatureAppearanceStream(InputStream value)
Sets a graphic appearance for the signature.
|
void |
sign(int page,
boolean visible,
Rectangle annotRect,
Signature sig)
Sign the document with the given type signature.
|
void |
sign(int page,
String SigReason,
String SigContact,
String SigLocation,
boolean visible,
Rectangle annotRect)
Make a signature on the pdf document.
|
void |
sign(int page,
String SigReason,
String SigContact,
String SigLocation,
boolean visible,
Rectangle annotRect,
Signature sig)
Sign the document with the given type signature.
|
void |
sign(int page,
String SigName,
String SigReason,
String SigContact,
String SigLocation,
boolean visible,
Rectangle annotRect,
Signature sig)
Sign the document with the given type signature which is placed in already presented
signature field.
|
void |
sign(String SigName,
Signature sig)
Sign the document with the given type signature which is placed in already presented
signature field.
|
void |
sign(String SigName,
String SigReason,
String SigContact,
String SigLocation,
Signature sig)
Sign the document with the given type signature which is placed in already presented
signature field.
|
boolean |
tryExtractCertificate(SignatureName signName,
OutputStream[] stream)
Extracts signature's single X.509 certificate as a stream.
|
boolean |
tryExtractCertificate(SignatureName signName,
com.aspose.ms.System.Security.Cryptography.X509Certificates.X509Certificate2[] certificate)
Extracts signature's single X.509 certificate.
|
boolean |
verifySignature(SignatureName signName)
Checks the validity of a signature.
|
boolean |
verifySignature(SignatureName signName,
com.aspose.pdf.engine.certificatevalidation.ValidationOptions options,
com.aspose.pdf.engine.certificatevalidation.ValidationResult[] validationResult)
Checks the validity of a signature.
|
boolean |
verifySignature(SignatureName signName,
com.aspose.ms.System.Security.Cryptography.X509Certificates.X509Certificate2 publicKeyCertificate)
Checks the validity of a signature.
|
boolean |
verifySignature(SignatureName signName,
com.aspose.ms.System.Security.Cryptography.X509Certificates.X509Certificate2 publicKeyCertificate,
com.aspose.pdf.engine.certificatevalidation.ValidationOptions options,
com.aspose.pdf.engine.certificatevalidation.ValidationResult[] validationResult)
Checks the validity of a signature.
|
boolean |
verifySignature(String signName)
Deprecated.
Use VerifySignature(SignatureName) method instead.
|
boolean |
verifySignature(String signName,
com.aspose.pdf.engine.certificatevalidation.ValidationOptions options,
com.aspose.pdf.engine.certificatevalidation.ValidationResult[] validationResult)
Deprecated.
Use VerifySignature(SignatureName, ValidationOptions, out ValidationResult) method instead.
|
boolean |
verifySigned(String signName)
Deprecated.
The method is deprecated and will be deleted in 25.1 version. Use VerifySignature method instead.
|
bindPdf, bindPdf, bindPdf, getDocument
public PdfFileSignature()
The constructor of PdfFileSignature class.
@Deprecated public PdfFileSignature(String inputFile)
The constructor of PdfFileSignature class.
inputFile
- The input file for signature.@Deprecated public PdfFileSignature(String inputFile, String outputFile)
The constructor of PdfFileSignature class.
inputFile
- The input file for signature.outputFile
- The output file.public PdfFileSignature(IDocument document)
Initializes new PdfFileSignature
object on base of the document
.
document
- Pdf document.@Deprecated public PdfFileSignature(IDocument document, String outputFile)
Initializes new PdfFileSignature
object on base of the document
.
document
- Pdf document.outputFile
- The output file.public String getSignatureAppearance()
Gets a graphic appearance for the signature. Property value represents image file name.
public void setSignatureAppearance(String value)
Sets a graphic appearance for the signature. Property value represents image file name.
value
- String valuepublic final boolean isLtvEnabled()
Gets the LTV enabled flag.
public void bindPdf(String inputFile)
Binds a Pdf file for editing.
public void bindPdf(InputStream inputStream)
Binds a Pdf stream for editing.
public void save(String outputFile)
Saves the result PDF to file.
save
in interface ISaveableFacade
save
in class SaveableFacade
outputFile
- output pdf filepublic void save(OutputStream outputStream)
Saves the result PDF to stream.
save
in interface ISaveableFacade
save
in class SaveableFacade
outputStream
- output pdf streampublic void sign(int page, String SigReason, String SigContact, String SigLocation, boolean visible, Rectangle annotRect)
Make a signature on the pdf document.
String inFile = TestPath + "example1.pdf"; String outFile = TestPath + "signature.pdf"; PdfFileSignature pdfSign = new PdfFileSignature(); pdfSign.bindPdf(inFile); Rectangle rect = new Rectangle(100, 100, 200, 200); pdfSign.setSignatureAppearance ( TestPath + "butterfly.jpg"); pdfSign.setCertificate("certificate.pfx", "password"); pdfSign.sign(2, "Allen", "success", "ChangSha", true, rect); pdfSign.save(outFile);
page
- The page number on which signature is made.SigReason
- The reason of signature.SigContact
- The contact of signature.SigLocation
- The location of signature.visible
- The visiblity of signature.annotRect
- The rect of signature.public void sign(int page, String SigReason, String SigContact, String SigLocation, boolean visible, Rectangle annotRect, Signature sig)
Sign the document with the given type signature.
String inFile = TestPath + "example1.pdf"; String outFile = TestPath + "signature.pdf"; PdfFileSignature pdfSign = new PdfFileSignature(inFile, outFile); Rectangle rect = new Rectangle(100, 100, 200, 100); pdfSign.setSignatureAppearance ( TestPath + "butterfly.jpg"); pdfSign.sign(2, "Allen", "success", "ChangSha", true, rect, new PKCS1("certificate.pfx", "password")); pdfSign.save();
page
- The page number on which signature is made.SigReason
- The reason of signature.SigContact
- The contact of signature.SigLocation
- The location of signature.visible
- The visiblity of signature.annotRect
- The rect of signature.sig
- The type of the signature, could be PKCS1, PKCS7 and PKCS7Detached.public void sign(int page, boolean visible, Rectangle annotRect, Signature sig)
Sign the document with the given type signature.
String inFile = TestPath + "example1.pdf"; String outFile = TestPath + "signature.pdf"; PKCS1 sig = new PKCS1("certificate.pfx", "password"); sig.setReason ( "Some reason"); sig.setContact ( "Smith"); sig.setLocation ( "New York"); PdfFileSignature pdfSign = new PdfFileSignature(inFile, outFile); Rectangle rect = new Rectangle(100, 100, 200, 100); pdfSign.setSignatureAppearance ( TestPath + "butterfly.jpg"); pdfSign.sign(2, true, rect, sig); pdfSign.save();
page
- The page number on which signature is made.visible
- The visiblity of signature.annotRect
- The rect of signature.sig
- The type of the signature, could be PKCS1, PKCS7 and PKCS7Detached. Such data as signature
reason, contact and location must be already present in this object (see corresponding
properties).public void sign(String SigName, String SigReason, String SigContact, String SigLocation, Signature sig)
Sign the document with the given type signature which is placed in already presented signature field. Before signing signature field must be empty, i.e. field must not contain signature dictionary. Thus pdf document already has signature field, you should not supply the place to stamp the signature, corresponding page and rectangle are taken from signature field which is found by signature name (see SigName parameter).
String inFile = TestPath + "example1.pdf"; String outFile = TestPath + "signature.pdf"; PKCS1 sig = new PKCS1("certificate.pfx", "password"); PdfFileSignature pdfSign = new PdfFileSignature(inFile, outFile); pdfSign.setSignatureAppearance ( TestPath + "butterfly.jpg"); pdfSign.sign("Signature1", "Allen", "success", "ChangSha", sig); pdfSign.save();
SigName
- The name of the signature field.SigReason
- The reason of signature.SigContact
- The contact of signature.SigLocation
- The location of signature.sig
- The type of the signature, could be PKCS1, PKCS7 and PKCS7Detached.public void sign(int page, String SigName, String SigReason, String SigContact, String SigLocation, boolean visible, Rectangle annotRect, Signature sig)
Sign the document with the given type signature which is placed in already presented signature field. Before signing pdf document should already has signature field, corresponding page and rectangle are taken from signature field which is found by signature name (see SigName parameter).
String inFile = TestPath + "blankWithSignature.pdf"; String outFile = TestPath + "signature.pdf"; PKCS7 sig = new PKCS7("certificate.pfx", "password"); PdfFileSignature pdfSign = new PdfFileSignature(inFile); Rectangle rect = new Rectangle(100, 100, 100, 100); pdfSign.setSignatureAppearance( TestPath + "butterfly.jpg"); pdfSign.sign(1, "Signature1", "ReasonToTest", "ContactMe", "SomeLocation", true, rect, sig); pdfSign.save(outFile);
page
- The page number on which signature is made.SigName
- The name of the signature field.SigReason
- The reason of signature.SigContact
- The contact of signature.SigLocation
- The location of signature.visible
- The visiblity of signature.annotRect
- The rect of signature.sig
- The type of the signature, could be PKCS1, PKCS7 and PKCS7Detached.public void sign(String SigName, Signature sig)
Sign the document with the given type signature which is placed in already presented signature field. Before signing signature field must be empty, i.e. field must not contain signature dictionary. Thus pdf document already has signature field, you should not supply the place to stamp the signature, corresponding page and rectangle are taken from signature field which is found by signature name (see SigName parameter). Such data as signature reason, contact and location must be provided by corresponding properties of the Signature object sig.
String inFile = TestPath + "example1.pdf"; String outFile = TestPath + "signature.pdf"; PKCS1 sig = new PKCS1("certificate.pfx", "password"); sig.setReason ( "Some reason"); sig.setContact ( "Smith"); sig.setLocation ( "New York"); PdfFileSignature pdfSign = new PdfFileSignature(inFile, outFile); pdfSign.setSignatureAppearance ( TestPath + "butterfly.jpg"); pdfSign.sign("Signature1", sig); pdfSign.save();
SigName
- The name of the signature field.sig
- The type of the signature, could be PKCS1 (Pkcs1Signature object), PKCS7 and PKCS7 detached
(Pkcs7Signature object)public boolean isCertified()
Gets the flag determining whether a document is certified or not.
public DocMDPAccessPermissions getAccessPermissions()
Returns the access permissions value of certified document by the MDP signature type.
DocMDPAccessPermissions
public void certify(int page, String SigReason, String SigContact, String SigLocation, boolean visible, Rectangle annotRect, DocMDPSignature docMdpSignature)
Certify the document with the MDP signature. Such data as signature reason, contact and location must be provided by corresponding properties of the Signature object sig.
page
- The page on which signature is made.SigReason
- The reason of signature.SigContact
- The contact of signature.SigLocation
- The location of signature.visible
- The visiblity of signature.annotRect
- The rect of signature.docMdpSignature
- The document MDP type of the signature.public final void certify(String sigName, DocMDPSignature docMdpSignature)
Certify the document with the MDP signature which is placed in already presented signature field. Before signing signature field must be empty, i.e. field must not contain signature dictionary. Thus pdf document already has signature field, you should not supply the place to stamp the signature, corresponding page and rectangle are taken from signature field which is found by signature name (see sigName parameter).
sigName
- The name of the signature field.docMdpSignature
- The type of the signature, could be PKCS1, PKCS7 and PKCS7Detachedpublic final List<String> getSignNames()
Gets the names of all not empty signatures.
@Deprecated public List<String> getSignNames(boolean onlyActive)
Gets the names of all not empty signatures.
String inFile=TestPath + "example1.pdf"; PdfFileSignature pdfSign=new PdfFileSignature(); pdfSign.bindPdf(inFile); ArrayList names=pdfSign.getSignNames(true); for(int i=0;i<names.Count;i++) { System.out.println("signature name:"+(String)names[i]); System.out.println("coverswholedocument:"+pdfSign.IsCoversWholeDocument((String)names[i])); System.out.println("revision:"+pdfSign.GetRevision((String)names[i])); System.out.println("verifysigned:"+pdfSign.VerifySigned((String)names[i])); System.out.println("reason:"+pdfSign.GetReason((String)names[i])); System.out.println("location:"+pdfSign.GetLocation((String)names[i])); System.out.println("datatime:"+pdfSign.GetDateTime((String)names[i])); } System.out.println("totalvision:"+pdfSign.GetTotalRevision());
onlyActive
- boolean value, if true, return only active signatures; otherwise, return all signatures.public final com.aspose.ms.System.Collections.Generic.IGenericList<SignatureName> getSignatureNames()
Gets the names of all not empty signatures.
string inFile=TestPath + "example1.pdf"; PdfFileSignature pdfSign=new PdfFileSignature(); pdfSign.bindPdf(inFile); java.util.List names=pdfSign.getSignatureNames(); for(int i=0;i<names.size();i++) { System.out.println("signature name:" + names[i]); System.out.println("coverswholedocument:" + pdfSign.coversWholeDocument(names[i])); System.out.println("revision:" + pdfSign.getRevision(names[i])); System.out.println("verifysigned:" + pdfSign.verifySignature(names[i])); System.out.println("reason:" + pdfSign.getReason(names[i])); System.out.println("location:" + pdfSign.getLocation(names[i])); System.out.println("datatime:" + pdfSign.getDateTime(names[i])); } System.out.println("totalvision:" + pdfSign.GetTotalRevision());
public final com.aspose.ms.System.Collections.Generic.IGenericList<SignatureName> getSignatureNames(boolean onlyActive)
Gets the names of all not empty signatures.
string inFile=TestPath + "example1.pdf"; PdfFileSignature pdfSign=new PdfFileSignature(); pdfSign.bindPdf(inFile); java.util.List names=pdfSign.getSignatureNames(); for(int i=0;i<names.size();i++) { System.out.println("signature name:" + names[i]); System.out.println("coverswholedocument:" + pdfSign.coversWholeDocument(names[i])); System.out.println("revision:" + pdfSign.getRevision(names[i])); System.out.println("verifysigned:" + pdfSign.verifySignature(names[i])); System.out.println("reason:" + pdfSign.getReason(names[i])); System.out.println("location:" + pdfSign.getLocation(names[i])); System.out.println("datatime:" + pdfSign.getDateTime(names[i])); } System.out.println("totalvision:" + pdfSign.GetTotalRevision());
onlyActive
- if true, return only active signatures; otherwise, return all signatures.@Deprecated public List<String> getBlankSignNames()
Gets the names of all empty signature fields.
@Deprecated public boolean isContainSignature()
Checks if the pdf has a digital signature or not.
public boolean containsSignature()
Checks if the pdf has a digital signature or not.
public boolean containsUsageRights()
Checks if the pdf has a usage rights or not.
@Deprecated public boolean isCoversWholeDocument(String signName)
Checks if the signature covers the whole document.
signName
- The name of signature.@Deprecated public boolean coversWholeDocument(String signName)
Checks if the signature covers the whole document.
signName
- The name of signature.public final boolean coversWholeDocument(SignatureName signName)
Checks if the signature covers the whole document.
signName
- The name of signature.@Deprecated public int getRevision(String signName)
Gets the revision of a signature.
signName
- The name of signature.public final int getRevision(SignatureName signName)
Gets the revision of a signature.
signName
- The name of signature.public int getTotalRevision()
Gets the toltal revision.
public void removeUsageRights()
Removes the usage rights entry.
@Deprecated public void removeSignature(String signName)
Remove the signature according to the name of the signature.
String inFile = TestPath + "example1.pdf"; PdfFileSignature pdfSign = new PdfFileSignature(); pdfSign.bindPdf(inFile); List names = pdfSign.getSignNames(); for(int i = 0; i < names.size(); i++) { pdfSign.removeSignature((String)names.get(i)); } pdfSign.save(TestPath + "signed_removed.pdf");
signName
- The name of signature.public final void removeSignature(SignatureName signName)
Remove the signature according to the name of the signature.
string inFile = TestPath + "example1.pdf"; PdfFileSignature pdfSign = new PdfFileSignature(); pdfSign.bindPdf(inFile); IList<SignatureName> names = pdfSign.getSignatureNames(); for(int i = 0; i < names.size(); i++) { pdfSign.removeSignature(names[i]); } pdfSign.save(TestPath + "signed_removed.pdf");
signName
- The name of signature.@Deprecated public void removeSignature(String signName, boolean removeField)
Removes the signature according to the name of the signature.
String inFile = TestPath + "example1.pdf"; PdfFileSignature pdfSign = new PdfFileSignature(); pdfSign.BindPdf(inFile); List names = pdfSign.getSignNames(); for(int i = 0; i < names.size(); i++) { pdfSign.removeSignature((String)names.get(i), false); } pdfSign.save(TestPath + "signed_removed.pdf");
signName
- The name of signature.removeField
- If set to true, than removes both of signature and field from document; otherwise, signature
only.public final void removeSignature(SignatureName signName, boolean removeField)
Removes the signature according to the name of the signature.
string inFile = TestPath + "example1.pdf"; PdfFileSignature pdfSign = new PdfFileSignature(); pdfSign.bindPdf(inFile); IList<SignatureName> names = pdfSign.getSignatureNames(); for(int i = 0; i < names.size(); i++) { pdfSign.removeSignature(names[i], false); } pdfSign.save(TestPath + "signed_removed.pdf");
signName
- The name of signature.removeField
- If set to true, than removes both of signature and field from document; otherwise, signature only.public final void removeSignatures()
Removes all signatures.
string inFile = TestPath + "example1.pdf"; var pdfSign = new PdfFileSignature(); pdfSign.bindPdf(inFile); pdfSign.removeSignatures(); pdfSign.save(TestPath + "signed_removed.pdf");
@Deprecated public boolean verifySigned(String signName)
Checks the validity of a signature. The method is deprecated and will be deleted in 25.1 version. Use VerifySignature method instead.
signName
- The name of signature.@Deprecated public String getSignerName(String signName)
Gets the name of person or organization who signing the pdf document.
signName
- The name of signature.public final String getSignerName(SignatureName signName)
Gets the name of person or organization who signing the pdf document.
signName
- The name of signature.@Deprecated public Date getDateTime(String signName)
Gets the signature's datetime.
signName
- The name of signature.public final Date getDateTime(SignatureName signName)
Gets the signature's datetime.
signName
- The name of signature.@Deprecated public String getReason(String signName)
Gets the reason of a signature.
signName
- The name of signature.public final String getReason(SignatureName signName)
Gets the reason of a signature.
signName
- The name of signature.@Deprecated public String getLocation(String signName)
Gets the location of a signature.
signName
- The name of signature.public final String getLocation(SignatureName signName)
Gets the location of a signature.
signName
- The name of signature.@Deprecated public String getContactInfo(String signName)
Gets the contact information of a signature.
signName
- The name of signature.public final String getContactInfo(SignatureName signName)
Gets the contact information of a signature.
signName
- The name of signature.@Deprecated public boolean verifySignature(String signName)
Checks the validity of a signature.
signName
- The name of signature.public final boolean verifySignature(SignatureName signName)
Checks the validity of a signature.
signName
- The name of signature.@Deprecated public final boolean verifySignature(String signName, com.aspose.pdf.engine.certificatevalidation.ValidationOptions options, com.aspose.pdf.engine.certificatevalidation.ValidationResult[] validationResult)
Checks the validity of a signature.
signName
- The name of signature.options
- The verification options.validationResult
- The certificate validation result.
This method allows you to check the signing certificate using OCSP and/or CRL (certificate revocation list) for revocation. This method does not check the certificate chain and its validity, but it does check whether the end certificate has been revoked.
public final boolean verifySignature(SignatureName signName, com.aspose.pdf.engine.certificatevalidation.ValidationOptions options, com.aspose.pdf.engine.certificatevalidation.ValidationResult[] validationResult)
Checks the validity of a signature.
signName
- The name of signature.options
- The verification options.validationResult
- The certificate validation result.
This method allows you to check the signing certificate using OCSP and/or CRL (certificate revocation list) for revocation. This method does not check the certificate chain and its validity, but it does check whether the end certificate has been revoked.
public final boolean verifySignature(SignatureName signName, com.aspose.ms.System.Security.Cryptography.X509Certificates.X509Certificate2 publicKeyCertificate, com.aspose.pdf.engine.certificatevalidation.ValidationOptions options, com.aspose.pdf.engine.certificatevalidation.ValidationResult[] validationResult)
Checks the validity of a signature. Verification is performed using the external public key certificate.
signName
- The name of signature.publicKeyCertificate
- The public key certificate for verification.options
- The verification options.validationResult
- The certificate validation result.
This method allows you to check the signing certificate using OCSP and/or CRL (certificate revocation list) for revocation. This method does not check the certificate chain and its validity, but it does check whether the end certificate has been revoked.
public final boolean verifySignature(SignatureName signName, com.aspose.ms.System.Security.Cryptography.X509Certificates.X509Certificate2 publicKeyCertificate)
Checks the validity of a signature. Verification is performed using the external public key certificate.
signName
- The name of signature.publicKeyCertificate
- The public key certificate for verification.public final List<com.aspose.pdf.engine.security.SignatureAlgorithmInfo> getSignaturesInfo()
Retrieves information about all signatures algorithm present in the PDF document.
SignatureAlgorithmInfo
instances containing information about each signature.@Deprecated public InputStream extractImage(String signName)
Extracts signature's image.
signName
- The name of signature.public final InputStream extractImage(SignatureName signName)
Extracts signature's image.
signName
- The name of signature.public InputStream extractCertificate(String signName)
Extracts signature's single X.509 certificate as a stream.
signName
- The name of signature.public final InputStream extractCertificate(SignatureName signName)
Extracts signature's single X.509 certificate as a stream.
signName
- The name of signature.public final boolean tryExtractCertificate(SignatureName signName, com.aspose.ms.System.Security.Cryptography.X509Certificates.X509Certificate2[] certificate)
Extracts signature's single X.509 certificate.
signName
- The name of signature.certificate
- If a certificate was found returns X.509 single certificate object; otherwise, null.public final boolean tryExtractCertificate(SignatureName signName, OutputStream[] stream) throws IOException
Extracts signature's single X.509 certificate as a stream.
signName
- The name of signature.stream
- If a certificate was found returns X.509 single certificate stream; otherwise, null.IOException
- possible an exception@Deprecated public void save()
Save signed pdf file. Output filename must be provided before with the help of coresponding PdfFileSignature constructor.
public void setCertificate(String pfx, String pass)
Set certificate file and password for signing routine.
pfx
- PKCS #12 certificate file.pass
- Password to get access for the certificate private key.public InputStream getSignatureAppearanceStream()
Gets a graphic appearance for the signature. Property value represents image stream.
public void setSignatureAppearanceStream(InputStream value)
Sets a graphic appearance for the signature. Property value represents image stream.
value
- InputStream elementpublic void close()
@Deprecated public void dispose()
Copyright © 2025 Aspose. All Rights Reserved.