DigitalSignature class

DigitalSignature class

The class contains digital signature properties.

The DigitalSignature type exposes the following members:

Constructors

Constructor Description
init Initializes a digital signature with default parameters.
init Initializes a digital signature with a known signature identifier.
init Initializes a DigitalSignature using the first certificate from the specified X509 store.
init Initializes a DigitalSignature based on the specified X509 store and certificate index.
init Initializes a digital signature with the specified certificate.

Methods

Method Description
clone Clones the barcode signature instance.
equals Compares this signature with another signature for equality.
equals_object
get_hash_code Returns the hash code for the digital signature.
load_digital_signatures Load digital signatures from all system X509 certificate stores.
load_digital_signatures Load digital signatures from a certificate storage.
load_digital_signatures Load digital signatures from a certificate storage.
load_digital_signatures Load digital signatures from a digital certificate storage placed in a specific location.
load_digital_signatures Loads digital signatures from a digital certificate storage placed at a specific location.
load_digital_signatures_file
load_digital_signatures_store_name
load_digital_signatures_string

Properties

Property Description
certificate The X509 certificate associated with the digital signature.
certificate_custom_store_name The custom store name of the certificate.
certificate_store_location The store location of the certificate.
certificate_store_name The store name of the certificate.
comments The signing purpose comment.
is_valid The digital signature is valid and the document has not been tampered with.
sign_time The time the document was signed.
thumbprint The thumbprint of a certificate.
xad_es_type The XAdES type (DigitalSignature.x_ad_es_type).
created_on The signature creation date. (inherited from BaseSignature)
deleted The flag indicating whether this signature was deleted from the document. (inherited from BaseSignature)
height The height of the signature. (inherited from BaseSignature)
is_signature The flag indicating whether this component represents a signature (True) or document content (False). (inherited from BaseSignature)
left The left position of the signature. (inherited from BaseSignature)
modified_on The signature modification date. (inherited from BaseSignature)
page_number The page number where the signature was found. (inherited from BaseSignature)
signature_id The unique identifier of the signature, used to modify the signature in the document via update or delete operations. (inherited from BaseSignature)
signature_type The type of signature. (inherited from BaseSignature)
top The top position of the signature. (inherited from BaseSignature)
width The width of the signature. (inherited from BaseSignature)

Example

from groupdocs.signature import Signature
from groupdocs.signature.options import DigitalSearchOptions

def list_digital_signatures():
    with Signature("signed.pdf") as signature:
        result = signature.search([DigitalSearchOptions()])
        for digital in result.signatures:
            print(f"Signed on {digital.sign_time}")
            print(f"Certificate subject: {digital.certificate.subject}")
            print(f"Valid: {digital.is_valid}")

if __name__ == "__main__":
    list_digital_signatures()

See Also