public class SigningInformation
extends java.lang.Object
| Constructor and Description |
|---|
SigningInformation(java.security.KeyStore ks,
java.lang.String entryAlias,
java.lang.String aliasPWD)
Constructs a SigningInformation object and gets the digital ID from a Java KeyStore object.
|
SigningInformation(java.lang.String pkcs12File,
java.lang.String ksPWD,
java.lang.String entryAlias,
java.lang.String aliasPWD)
Constructs a SigningInformation object and gets the digital ID from a named PKCS#12 file.
|
| Modifier and Type | Method and Description |
|---|---|
java.security.cert.Certificate[] |
getCertificateChain()
Returns the certificate chain for the issuers of the certificate in the key store.
|
java.lang.String |
getContactInformation()
Returns the contact information used in the signature.
|
java.util.Hashtable<java.lang.String,java.lang.String> |
getCustomProperties()
Returns the custom properties table.
|
java.lang.String |
getLocation()
Gets the location to be used in the signature.
|
java.security.PrivateKey |
getPrivateKey()
Returns the private key retrieved from the KeyStore or PKCS #12 file.
|
java.lang.String |
getProperty(java.lang.String key)
This method can be used to retrieve the values of custom properties
|
java.lang.String |
getReason()
Gets the reason for signing to be used in the signature.
|
SignatureAppearance |
getSignatureAppearance()
Returns the
SignatureAppearance to use when creating the
signature appearance stream. |
java.security.cert.Certificate |
getSignerCertificate()
Returns the certificate for the digital id retrieved from the KeyStore or the PKCS#12 file.
|
void |
setContactInformation(java.lang.String contactInformation)
Sets the contact information to be used in the signature.
|
void |
setCustomProperty(java.lang.String key,
java.lang.String value)
This method can be used to add additional custom properties to the signature dictionary.
|
void |
setLocation(java.lang.String location)
Sets the location to be used in the signature.
|
void |
setReason(java.lang.String reason)
Sets the reason for signing to be used in the signature.
|
void |
setSignatureAppearance(SignatureAppearance signAppearance)
Sets the
SignatureAppearance to use when creating the
signature appearance stream. |
public SigningInformation(java.lang.String pkcs12File,
java.lang.String ksPWD,
java.lang.String entryAlias,
java.lang.String aliasPWD)
throws java.security.GeneralSecurityException,
java.io.IOException,
PDFException
pkcs12File - The name of the PKCS#12 key store fileksPWD - The key store passwordentryAlias - The alias of the entry to be used in signing.aliasPWD - The password to the alias entry.java.security.GeneralSecurityExceptionjava.io.IOExceptionPDFExceptionpublic SigningInformation(java.security.KeyStore ks,
java.lang.String entryAlias,
java.lang.String aliasPWD)
throws java.security.GeneralSecurityException,
PDFException
ks - The KeyStore object that contains the digital ID.entryAlias - The alias of the entry to be used in signing.aliasPWD - The password to the alias entry.java.security.GeneralSecurityExceptionPDFExceptionpublic java.lang.String getContactInformation()
public void setContactInformation(java.lang.String contactInformation)
contactInformation - The new contact information.public java.lang.String getLocation()
public void setLocation(java.lang.String location)
location - The new location.public java.lang.String getReason()
public void setReason(java.lang.String reason)
reason - The new reason.public java.security.PrivateKey getPrivateKey()
public java.security.cert.Certificate getSignerCertificate()
public java.security.cert.Certificate[] getCertificateChain()
public void setSignatureAppearance(SignatureAppearance signAppearance)
SignatureAppearance to use when creating the
signature appearance stream.signAppearance - the signAppearance to use when creating the signature appearance streampublic SignatureAppearance getSignatureAppearance()
SignatureAppearance to use when creating the
signature appearance stream.public java.lang.String getProperty(java.lang.String key)
key - The key for the custom propertypublic void setCustomProperty(java.lang.String key,
java.lang.String value)
throws PDFException
key - A unique key for the custom propertyvalue - The vale of the custom propertyPDFExceptionpublic java.util.Hashtable<java.lang.String,java.lang.String> getCustomProperties()