DigitalSignature

Inheritance: java.lang.Object, com.groupdocs.signature.domain.signatures.BaseSignature

public class DigitalSignature extends BaseSignature

Contains Digital signature properties.

Constructors

Constructor Description
DigitalSignature() Initialize Digital signature with default parameters.
DigitalSignature(String signatureId) Initialize Digital signature with known SignatureId.
DigitalSignature(KeyStore certificate) Create Digital signature with specified certificate.

Methods

Method Description
getCertificate() Gets or sets the X509 certificate.
setCertificate(KeyStore value) Gets or sets the X509 certificate.
getCertificateName() Gets or sets the X509 certificate name.
setCertificateName(String value) Gets or sets the X509 certificate name.
getComments() Gets or sets the signing purpose comment.
setComments(String value) Gets or sets the signing purpose comment.
isValid() Keeps true if this digital signature is valid and the document has not been tampered with.
setValid(boolean value) Keeps true if this digital signature is valid and the document has not been tampered with.
getSignTime() Gets or sets the time the document was signed.
setSignTime(Date value) Gets or sets the time the document was signed.
getXAdESType() XAdES type XAdESType .
setXAdESType(int value) XAdES type XAdESType .
getThumbprint() Gets the thumbprint of a certificate.
equals(Object signature) Overwrites Equals method to compare signature properties
hashCode() Overrides GetHashCode method
deepClone() Clone Barcode Signature instance.
loadDigitalSignatures() Load Digital signature from all system X509 Certificates Stores.
loadDigitalSignatures(StoreName storeName) Load Digital signature from passed X509 Certificates Store.

DigitalSignature()

public DigitalSignature()

Initialize Digital signature with default parameters.

DigitalSignature(String signatureId)

public DigitalSignature(String signatureId)

Initialize Digital signature with known SignatureId.

Parameters:

Parameter Type Description
signatureId java.lang.String

DigitalSignature(KeyStore certificate)

public DigitalSignature(KeyStore certificate)

Create Digital signature with specified certificate.

Parameters:

Parameter Type Description
certificate java.security.KeyStore X509 certificate.

getCertificate()

public final KeyStore getCertificate()

Gets or sets the X509 certificate.

Returns: java.security.KeyStore

setCertificate(KeyStore value)

public final void setCertificate(KeyStore value)

Gets or sets the X509 certificate.

Parameters:

Parameter Type Description
value java.security.KeyStore

getCertificateName()

public final String getCertificateName()

Gets or sets the X509 certificate name.

Returns: java.lang.String

setCertificateName(String value)

public final void setCertificateName(String value)

Gets or sets the X509 certificate name.

Parameters:

Parameter Type Description
value java.lang.String

getComments()

public final String getComments()

Gets or sets the signing purpose comment.

Returns: java.lang.String

setComments(String value)

public final void setComments(String value)

Gets or sets the signing purpose comment.

Parameters:

Parameter Type Description
value java.lang.String

isValid()

public final boolean isValid()

Keeps true if this digital signature is valid and the document has not been tampered with.

Returns: boolean

setValid(boolean value)

public final void setValid(boolean value)

Keeps true if this digital signature is valid and the document has not been tampered with.

Parameters:

Parameter Type Description
value boolean

getSignTime()

public final Date getSignTime()

Gets or sets the time the document was signed.

Returns: java.util.Date

setSignTime(Date value)

public final void setSignTime(Date value)

Gets or sets the time the document was signed.

Parameters:

Parameter Type Description
value java.util.Date

getXAdESType()

public final int getXAdESType()

XAdES type XAdESType . Default value is None (XAdES is off). At this moment XAdES signature type is supported only for Spreadsheet documents.

Returns: int

setXAdESType(int value)

public final void setXAdESType(int value)

XAdES type XAdESType . Default value is None (XAdES is off). At this moment XAdES signature type is supported only for Spreadsheet documents.

Parameters:

Parameter Type Description
value int

getThumbprint()

public final String getThumbprint()

Gets the thumbprint of a certificate.

Returns: java.lang.String

equals(Object signature)

public boolean equals(Object signature)

Overwrites Equals method to compare signature properties

Parameters:

Parameter Type Description
signature java.lang.Object Signature object to compare with.

Returns: boolean - Returns true if passed signature object has same type and all its properties are equal to this instance properties.

hashCode()

public int hashCode()

Overrides GetHashCode method

Returns: int - Signature hash code

deepClone()

public Object deepClone()

Clone Barcode Signature instance.

Returns: java.lang.Object - Returns cloned Barcode Signature instance.

loadDigitalSignatures()

public static List<DigitalSignature> loadDigitalSignatures()

Load Digital signature from all system X509 Certificates Stores.

Returns: java.util.List<com.groupdocs.signature.domain.signatures.DigitalSignature> - Returns list of DigitalSignature Digital Signatures.

loadDigitalSignatures(StoreName storeName)

public static List<DigitalSignature> loadDigitalSignatures(StoreName storeName)

Load Digital signature from passed X509 Certificates Store.

Parameters:

Parameter Type Description
storeName StoreName

Returns: java.util.List<com.groupdocs.signature.domain.signatures.DigitalSignature> - Returns list of DigitalSignature Digital Signatures.