Class Signature
java.lang.Object
com.ironsoftware.ironpdf.signature.Signature
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 Summary
ConstructorDescriptionInitializes a new instance of theSignature
class.Signature
(byte[] certificateRawData, String password, Instant signatureDate, byte[] signatureImage, String signingContact, String signingLocation, String signingReason) Initializes a new instance of theSignature
class.Initializes a new instance of theSignature
class using a .pfx or .p12 digital signature file.Initializes a new instance of theSignature
class using a .pfx or .p12 digital signature file. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Get certificate raw data byte [ ].Gets password.Gets signature date.byte[]
Get signature image.Gets signing contact.Gets signing location.Gets signing reason.Gets Url to be used when time-stamping the signaturevoid
setCertificateRawData
(byte[] certificateRawData) Sets certificate raw data.void
setPassword
(String password) Sets password.void
setSignatureDate
(Instant signatureDate) Sets signature date.void
setSignatureImage
(byte[] signatureImage) Sets signature image.void
setSigningContact
(String signingContact) Sets signing contact.void
setSigningLocation
(String signingLocation) Sets signing location.void
setSigningReason
(String signingReason) Sets signing reason.void
setTimeStampUrl
(String timeStampUrl) Sets Url to be used when time-stamping the signature
-
Constructor Details
-
Signature
Initializes a new instance of theSignature
class 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
-
Signature
Initializes a new instance of theSignature
class 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
-
Signature
Initializes a new instance of theSignature
class.- Parameters:
certificateRawData
- The certificate as a binary data (byte array).password
- The certificate's password.
-
Signature
public Signature(byte[] certificateRawData, String password, Instant signatureDate, byte[] signatureImage, String signingContact, String signingLocation, String signingReason) Initializes a new instance of theSignature
class.- 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 Details
-
getCertificateRawData
public byte[] getCertificateRawData()Get certificate raw data byte [ ].- Returns:
- the byte [ ]
-
setCertificateRawData
public void setCertificateRawData(byte[] certificateRawData) Sets certificate raw data.- Parameters:
certificateRawData
- the certificate raw data
-
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
-
setSignatureDate
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
-
getSignatureImage
public 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[]
-
setSignatureImage
public 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
-
getSigningContact
Gets signing contact. The contact person or email address for signing related inquiries (optional).- Returns:
- the signing contact
-
setSigningContact
Sets signing contact. The contact person or email address for signing related inquiries (optional).- Parameters:
signingContact
- the signing contact
-
getSigningLocation
Gets signing location. The physical location the PDF was signed (optional).- Returns:
- the signing location
-
setSigningLocation
Sets signing location. The physical location the PDF was signed (optional).- Parameters:
signingLocation
- the signing location
-
getSigningReason
Gets signing reason. The reason the PDF was signed (optional).- Returns:
- the signing reason
-
setSigningReason
Sets signing reason. The reason the PDF was signed (optional).- Parameters:
signingReason
- the signing reason
-
getPassword
Gets password.- Returns:
- the password
-
setPassword
Sets password.- Parameters:
password
- the password
-
getTimeStampUrl
Gets Url to be used when time-stamping the signature- Returns:
- the timestamp url
-
setTimeStampUrl
Sets Url to be used when time-stamping the signature- Parameters:
timeStampUrl
- the timestamp url
-