Skip to main content

A library for interacting with the Criipto signatures GraphQL API.

Project description

criipto-signatures

A python SDK for Criipto Signatures.

Sign PAdeS-LTA documents using MitID, BankID or any other eID supported by Criipto.

Examples

Getting started

Requirements

This library supports python 3.13 and later.

Installation

The SDK is available on PYPI:

python3 -m pip install criipto-signatures

Configure the SDK

The SDK is available in both a sync and an async version

from criipto_signatures import (
  CriiptoSignaturesSDKAsync,
  CriiptoSignaturesSDKSync,
)
asyncClient = CriiptoSignaturesSDKAsync(
    '{YOUR_CRIIPTO_CLIENT_ID}',
    '{YOUR_CRIIPTO_CLIENT_SECRET}'
)
syncClient = CriiptoSignaturesSDKSync(
    '{YOUR_CRIIPTO_CLIENT_ID}',
    '{YOUR_CRIIPTO_CLIENT_SECRET}'
)

Basic example

from criipto_signatures import CriiptoSignaturesSDKAsync
from criipto_signatures.models import (
    CreateSignatureOrderInput,
    DocumentInput,
    PadesDocumentInput,
    DocumentStorageMode,
    AddSignatoryInput,
    CloseSignatureOrderInput,
)

client = CriiptoSignaturesSDKAsync(
    '{YOUR_CRIIPTO_CLIENT_ID}',
    '{YOUR_CRIIPTO_CLIENT_SECRET}'
)

# Create signature order
signatureOrder = await client.createSignatureOrder(
    CreateSignatureOrderInput(
        documents=[
            DocumentInput(
                pdf=PadesDocumentInput(
                    title="My document",
                    blob=data, # bytes object, or a base64 encoded string
                    storageMode=DocumentStorageMode.Temporary,
                )
            )
        ]
    )
)

# Add signatory to signature order
signatory = await client.addSignatory(
    AddSignatoryInput(
        signatureOrderId=signatureOrder.id
    )
)
print(signatory.href)

# ... Wait for the signatory to sign

# And close the order
await client.closeSignatureOrder(
    CloseSignatureOrderInput(
        signatureOrderId=signatureOrder.id,
        retainDocumentsForDays=1
    )
)

For a more complete example, see the example project

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

criipto_signatures-1.28.1.tar.gz (543.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

criipto_signatures-1.28.1-py3-none-any.whl (546.7 kB view details)

Uploaded Python 3

File details

Details for the file criipto_signatures-1.28.1.tar.gz.

File metadata

  • Download URL: criipto_signatures-1.28.1.tar.gz
  • Upload date:
  • Size: 543.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.5

File hashes

Hashes for criipto_signatures-1.28.1.tar.gz
Algorithm Hash digest
SHA256 64a9a6f81974288fc0f51f108f4ac10978feff0eb2f3561a0e91f7bb2cc1fa1d
MD5 458157025f97aaff758536f02ebe1ed4
BLAKE2b-256 e52091b015b7c022b80f774927db4aea60eddd00f0357b2cd6e0ab0127ca2930

See more details on using hashes here.

File details

Details for the file criipto_signatures-1.28.1-py3-none-any.whl.

File metadata

File hashes

Hashes for criipto_signatures-1.28.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b7dc70772495fa8fb776aec53af6719ebd86bad59424efe735f4eeefed1a1606
MD5 75bed9c5b1e16f217599a50e0f59d4e5
BLAKE2b-256 ed63e7b60465323371c46cb2aacb78dad986accf2ef3c4d223747385cb8c66e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page