public class DigitalSignature extends java.lang.Object implements IDigitalSignature
Digital signature in signed file.
Constructor and Description |
---|
DigitalSignature(byte[] certData,
java.lang.String password)
Creates a new DigitalSignature object with the specified certificate.
|
DigitalSignature(java.lang.String filePath,
java.lang.String password)
Creates a new DigitalSignature object with the specified certificate file path and password.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getCertificate()
Certificate object that was used to sign the document.
|
java.lang.String |
getComments()
The purpose of signature.
|
java.util.Date |
getSignTime()
The time when the document was signed.
|
boolean |
isValid()
If this digital signature is valid and the document has not been tampered with, this value will be true.
|
void |
setComments(java.lang.String value)
The purpose of signature.
|
public DigitalSignature(byte[] certData, java.lang.String password)
Creates a new DigitalSignature object with the specified certificate.
certData
- a byte array containing the certificatepassword
- Password required to access certificate.public DigitalSignature(java.lang.String filePath, java.lang.String password)
Creates a new DigitalSignature object with the specified certificate file path and password.
filePath
- Path to the file with certificate.password
- Password required to access certificate.public final byte[] getCertificate()
Certificate object that was used to sign the document.
Read-only byte[]
.
getCertificate
in interface IDigitalSignature
public final boolean isValid()
If this digital signature is valid and the document has not been tampered with, this value will be true.
Read-only boolean
.
Presentation pres = new Presentation("SomePresentationSigned.pptx"); try { for (IDigitalSignature signature : pres.getDigitalSignatures()) System.out.println("Signature check: " + (signature.isValid() ? "VALID" : "INVALID")); } finally { if (pres != null) pres.dispose(); }
isValid
in interface IDigitalSignature
public final java.util.Date getSignTime()
The time when the document was signed.
Read-only Date
.
Presentation pres = new Presentation("SomePresentationSigned.pptx"); try { for (IDigitalSignature signature : pres.getDigitalSignatures()) System.out.println("Signature check: " + (signature.isValid() ? "VALID" : "INVALID") + ", Signing time: " + signature.getSignTime()); } finally { if (pres != null) pres.dispose(); }
getSignTime
in interface IDigitalSignature
public final java.lang.String getComments()
The purpose of signature.
Read/write String
.
getComments
in interface IDigitalSignature
public final void setComments(java.lang.String value)
The purpose of signature.
Read/write String
.
setComments
in interface IDigitalSignature