Class Signature
- java.lang.Object
- 
- com.ironsoftware.ironpdf.signature.Signature
 
- 
 public class Signature extends Object A class that represents a PDF signing certificate (.PFX or .p12) format which can be used to digitally sign a PDF. This protecting it from alteration.
- 
- 
Constructor SummaryConstructors Constructor Description Signature(byte[] certificateRawData, String password)Initializes a new instance of theSignatureclass.Signature(byte[] certificateRawData, String password, Instant signatureDate, byte[] signatureImage, String signingContact, String signingLocation, String signingReason)Initializes a new instance of theSignatureclass.Signature(String filePathToCertificate, String password)Initializes a new instance of theSignatureclass using a .pfx or .p12 digital signature file.Signature(Path filePathToCertificate, String password)Initializes a new instance of theSignatureclass using a .pfx or .p12 digital signature file.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getCertificateRawData()Get certificate raw data byte [ ].intgetInternalIndex()Internal using onlyStringgetPassword()Gets password.InstantgetSignatureDate()Gets signature date.byte[]getSignatureImage()Get signature image.StringgetSigningContact()Gets signing contact.StringgetSigningLocation()Gets signing location.StringgetSigningReason()Gets signing reason.StringgetTimeStampUrl()Gets Url to be used when time-stamping the signaturevoidsetCertificateRawData(byte[] certificateRawData)Sets certificate raw data.voidsetPassword(String password)Sets password.voidsetSignatureDate(Instant signatureDate)Sets signature date.voidsetSignatureImage(byte[] signatureImage)Sets signature image.voidsetSigningContact(String signingContact)Sets signing contact.voidsetSigningLocation(String signingLocation)Sets signing location.voidsetSigningReason(String signingReason)Sets signing reason.voidsetTimeStampUrl(String timeStampUrl)Sets Url to be used when time-stamping the signature
 
- 
- 
- 
Constructor Detail- 
Signaturepublic Signature(String filePathToCertificate, String password) throws IOException Initializes a new instance of theSignatureclass using a .pfx or .p12 digital signature file.- Parameters:
- filePathToCertificate- The file path to certificate.
- password- The certificate's password.
- Throws:
- IOException- if an I/O error occurs reading from the stream
 
 - 
Signaturepublic Signature(Path filePathToCertificate, String password) throws IOException Initializes a new instance of theSignatureclass using a .pfx or .p12 digital signature file.- Parameters:
- filePathToCertificate- The file path to certificate.
- password- The certificate's password.
- Throws:
- IOException- if an I/O error occurs reading from the stream
 
 - 
Signaturepublic Signature(byte[] certificateRawData, String password)Initializes a new instance of theSignatureclass.- Parameters:
- certificateRawData- The certificate as a binary data (byte array).
- password- The certificate's password.
 
 - 
Signaturepublic Signature(byte[] certificateRawData, String password, Instant signatureDate, byte[] signatureImage, String signingContact, String signingLocation, String signingReason)Initializes a new instance of theSignatureclass.- Parameters:
- certificateRawData- the certificate as a binary data (byte array).
- password- the certificate's password.
- signatureDate- the date and time of the digital signature. If left null, the signature will be timestamped at the millisecond that the PdfDocument is saved to Disk or Stream.
- signatureImage- a visual image for the sign, often a PNG of a human signature or company stamp (optional).- This appends a visual signature in addition to cryptographic signing. 
- signingContact- the contact person or email address for signing related inquiries (optional).
- signingLocation- the physical location the PDF was signed (optional).
- signingReason- the reason the PDF was signed (optional).
 
 
- 
 - 
Method Detail- 
getCertificateRawDatapublic byte[] getCertificateRawData() Get certificate raw data byte [ ].- Returns:
- the byte [ ]
 
 - 
setCertificateRawDatapublic void setCertificateRawData(byte[] certificateRawData) Sets certificate raw data.- Parameters:
- certificateRawData- the certificate raw data
 
 - 
getSignatureDatepublic Instant getSignatureDate() Gets signature date. The date and time of the digital signature. If left null, the signature will be timestamped at the millisecond that the PdfDocument is saved to Disk or Stream.- Returns:
- the signature date
 
 - 
setSignatureDatepublic void setSignatureDate(Instant signatureDate) Sets signature date. The date and time of the digital signature. If left null, the signature will be timestamped at the millisecond that the PdfDocument is saved to Disk or Stream.- Parameters:
- signatureDate- the signature date
 
 - 
getSignatureImagepublic byte[] getSignatureImage() Get signature image. A visual image for the sign, often a PNG of a human signature or company stamp (optional).This appends a visual signature in addition to cryptographic signing. - Returns:
- the image byte[]
 
 - 
setSignatureImagepublic void setSignatureImage(byte[] signatureImage) Sets signature image. A visual image for the sign, often a PNG of a human signature or company stamp (optional).This appends a visual signature in addition to cryptographic signing. - Parameters:
- signatureImage- the signature image
 
 - 
getSigningContactpublic String getSigningContact() Gets signing contact. The contact person or email address for signing related inquiries (optional).- Returns:
- the signing contact
 
 - 
setSigningContactpublic void setSigningContact(String signingContact) Sets signing contact. The contact person or email address for signing related inquiries (optional).- Parameters:
- signingContact- the signing contact
 
 - 
getSigningLocationpublic String getSigningLocation() Gets signing location. The physical location the PDF was signed (optional).- Returns:
- the signing location
 
 - 
setSigningLocationpublic void setSigningLocation(String signingLocation) Sets signing location. The physical location the PDF was signed (optional).- Parameters:
- signingLocation- the signing location
 
 - 
getSigningReasonpublic String getSigningReason() Gets signing reason. The reason the PDF was signed (optional).- Returns:
- the signing reason
 
 - 
setSigningReasonpublic void setSigningReason(String signingReason) Sets signing reason. The reason the PDF was signed (optional).- Parameters:
- signingReason- the signing reason
 
 - 
getPasswordpublic String getPassword() Gets password.- Returns:
- the password
 
 - 
setPasswordpublic void setPassword(String password) Sets password.- Parameters:
- password- the password
 
 - 
getTimeStampUrlpublic String getTimeStampUrl() Gets Url to be used when time-stamping the signature- Returns:
- the timestamp url
 
 - 
setTimeStampUrlpublic void setTimeStampUrl(String timeStampUrl) Sets Url to be used when time-stamping the signature- Parameters:
- timeStampUrl- the timestamp url
 
 - 
getInternalIndexpublic int getInternalIndex() Internal using only
 
- 
 
-