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
client = CriiptoSignaturesSDKAsync(
    '{YOUR_CRIIPTO_CLIENT_ID}',
    '{YOUR_CRIIPTO_CLIENT_SECRET}'
)

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

# Create signature order
createSignatureOrderResponse = 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
addSignatoryResponse = await client.addSignatory(
    AddSignatoryInput(
        signatureOrderId=createSignatureOrderResponse.signatureOrder.id
    )
)
print(addSignatoryResponse.signatory.href)

# ... Wait for the signatory to sign

# And close the order
await client.closeSignatureOrder(
    CloseSignatureOrderInput(
        signatureOrderId=createSignatureOrderResponse.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-0.1.0a3.tar.gz (540.8 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-0.1.0a3-py3-none-any.whl (544.0 kB view details)

Uploaded Python 3

File details

Details for the file criipto_signatures-0.1.0a3.tar.gz.

File metadata

File hashes

Hashes for criipto_signatures-0.1.0a3.tar.gz
Algorithm Hash digest
SHA256 25262b03ef647e7f7545daa3f929c927f71c234437880dfa1645833223b58ad2
MD5 ea8859e8e9cbe4294eb96cb4d37a2602
BLAKE2b-256 6cf59d376ab6d27b2c4f14efb086990863e0442dddb73b17087bc80a9c83033c

See more details on using hashes here.

File details

Details for the file criipto_signatures-0.1.0a3-py3-none-any.whl.

File metadata

File hashes

Hashes for criipto_signatures-0.1.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 ba0f506ed1ee4e465e34bab78adfd68f57284c7ab1d506e091f69bf66346ccd3
MD5 b74ba1467ac9965b83489cba0aeef784
BLAKE2b-256 5688259095fd0c91722e87dbd3d4210bfeb09097a4bd1d516f7a47e2e83798bd

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