Package com.winnovative_software
Class DigitalSignatureElement
java.lang.Object
com.winnovative_software.PageElement
com.winnovative_software.DigitalSignatureElement
Represents a digital signature in the PDF document
-
Constructor Summary
ConstructorsConstructorDescriptionDigitalSignatureElement
(byte[] pfxData, String pfxPassword, int certificateIndex) Constructs a digital signature element that can be applied to a PDF document in the position where the last PDF element was renderedDigitalSignatureElement
(RectangleFloat bounds, byte[] pfxData, String pfxPassword, int certificateIndex) Constructs a digital signature element that can be applied to a PDF page in the given positionDigitalSignatureElement
(RectangleFloat bounds, String pfxFile, String pfxPassword, int certificateIndex) * Constructs a digital signature element that can be applied to a PDF page in the given positionDigitalSignatureElement
(String pfxFile, String pfxPassword, int certificateIndex) Constructs a digital signature element that can be applied to a PDF document in the position where the last PDF element was rendered -
Method Summary
Modifier and TypeMethodDescriptionbounds()
Gets the bounds of the rectangle where the certificate will be applied in PDF pageint
Gets the certificate index in collection of certificates stored in PFX fileGets the information provided by the signer to enable a recipient to contact the signer to verify the signature; for example, a phone numberlocation()
Gets the CPU host name or physical location of the signingbyte[]
pfxData()
Gets the binary data of a PFX file containing the certificate used for signing.Gets the password to access the PFX filereason()
Gets the reason for the signingvoid
setBounds
(RectangleFloat bounds) Sets the bounds of the rectangle where the certificate will be applied in PDF page.void
setCertificateIndex
(int certificateIndex) Sets the certificate index in collection of certificates stored in PFX filevoid
setContactInfo
(String contactInfo) Sets the information provided by the signer to enable a recipient to contact the signer to verify the signature; for example, a phone numbervoid
setLocation
(String location) Sets the CPU host name or physical location of the signingvoid
setPfxData
(byte[] pfxData) Sets the binary data of a PFX file containing the certificate used for signing.void
setPfxPassword
(String pfxPassword) Sets the password to access the PFX file.void
Sets the reason for the signing
-
Constructor Details
-
DigitalSignatureElement
public DigitalSignatureElement(String pfxFile, String pfxPassword, int certificateIndex) throws Exception Constructs a digital signature element that can be applied to a PDF document in the position where the last PDF element was rendered- Parameters:
pfxFile
- the PFX file containing the certificate used for signing. The PFX file is expected to contain both the private and public keypfxPassword
- the password to access the PFX file. It can be null or empty if no password is requiredcertificateIndex
- the certificate index in collection of certificates stored in PFX file. By default the first certificate in collection is used- Throws:
Exception
- an exception is thrown if the PFX data cannot be read from file
-
DigitalSignatureElement
public DigitalSignatureElement(RectangleFloat bounds, String pfxFile, String pfxPassword, int certificateIndex) throws Exception * Constructs a digital signature element that can be applied to a PDF page in the given position- Parameters:
bounds
- the bounds of the rectangle where the certificate will be applied in PDF pagepfxFile
- the PFX file containing the certificate used for signing. The PFX file is expected to contain both the private and public keypfxPassword
- the password to access the PFX file. It can be null or empty if no password is requiredcertificateIndex
- the certificate index in collection of certificates stored in PFX file. By default the first certificate in collection is used- Throws:
Exception
- an exception is thrown if the PFX data cannot be read from file
-
DigitalSignatureElement
Constructs a digital signature element that can be applied to a PDF document in the position where the last PDF element was rendered- Parameters:
pfxData
- the binary data of a PFX file containing the certificate used for signing. The PFX file is expected to contain both the private and public keypfxPassword
- the password to access the PFX file. It can be null or empty if no password is requiredcertificateIndex
- the certificate index in collection of certificates stored in PFX file. By default the first certificate in collection is used
-
DigitalSignatureElement
public DigitalSignatureElement(RectangleFloat bounds, byte[] pfxData, String pfxPassword, int certificateIndex) Constructs a digital signature element that can be applied to a PDF page in the given position- Parameters:
bounds
- the bounds of the rectangle where the certificate will be applied in PDF pagepfxData
- the binary data of a PFX file containing the certificate used for signing. The PFX file is expected to contain both the private and public keypfxPassword
- the password to access the PFX file. It can be null or empty if no password is requiredcertificateIndex
- the certificate index in collection of certificates stored in PFX file. By default the first certificate in collection is used
-
-
Method Details
-
pfxData
public byte[] pfxData()Gets the binary data of a PFX file containing the certificate used for signing.- Returns:
- the binary data of a PFX file containing the certificate used for signing
-
setPfxData
public void setPfxData(byte[] pfxData) Sets the binary data of a PFX file containing the certificate used for signing. The PFX file is expected to contain both the private and public key- Parameters:
pfxData
- the binary data of a PFX file containing the certificate used for signing
-
bounds
Gets the bounds of the rectangle where the certificate will be applied in PDF page- Returns:
- the bounds of the rectangle where the certificate will be applied in PDF page
-
setBounds
Sets the bounds of the rectangle where the certificate will be applied in PDF page. If the bounds is null the certificate will be applied in PDF document where the last PDF element was rendered- Parameters:
bounds
- the bounds of the rectangle where the certificate will be applied in PDF page
-
pfxPassword
Gets the password to access the PFX file- Returns:
- the password to access the PFX file
-
setPfxPassword
Sets the password to access the PFX file. It can be null or empty if no password is required- Parameters:
pfxPassword
- the password to access the PFX file
-
certificateIndex
public int certificateIndex()Gets the certificate index in collection of certificates stored in PFX file- Returns:
- the certificate index in collection of certificates stored in PFX file
-
setCertificateIndex
public void setCertificateIndex(int certificateIndex) Sets the certificate index in collection of certificates stored in PFX file- Parameters:
certificateIndex
- the certificate index in collection of certificates stored in PFX file
-
reason
Gets the reason for the signing- Returns:
- the reason for the signing
-
setReason
Sets the reason for the signing- Parameters:
reason
- the reason for the signing
-
location
Gets the CPU host name or physical location of the signing- Returns:
- the CPU host name or physical location of the signing
-
setLocation
Sets the CPU host name or physical location of the signing- Parameters:
location
- the CPU host name or physical location of the signing
-
contactInfo
Gets the information provided by the signer to enable a recipient to contact the signer to verify the signature; for example, a phone number- Returns:
- the information provided by the signer
-
setContactInfo
Sets the information provided by the signer to enable a recipient to contact the signer to verify the signature; for example, a phone number- Parameters:
contactInfo
- the information provided by the signer
-