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.30.0.tar.gz (545.1 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.30.0-py3-none-any.whl (548.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for criipto_signatures-1.30.0.tar.gz
Algorithm Hash digest
SHA256 8d1fc9ab65699e45a6bca71e756c4bd53965ae4aa5b132bcbfdd9575a9aefad0
MD5 c1af8a4ddda966300b4d81edb401f8f8
BLAKE2b-256 4f9b23321d3b9214b595bad6d98bf4aab9d562c9e95dcea613060c168967e4b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for criipto_signatures-1.30.0-py3-none-any.whl
Algorithm Hash digest
SHA256 678ac3999850cd12032dfc7b0ab5b1d459225a2760f3e0cbbea0f27f6c31d882
MD5 70111ffe6459d8d5fd20de6c98d62c67
BLAKE2b-256 e0210274448da19d68372a100958a52a16616af88da3daba9cca261c5bfbcd80

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