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}'
)

Overriding the GraphQL endpoint

By default the SDK targets https://signatures-api.criipto.com/v1/graphql. https://signatures.idura.app is the future home of the Idura Signatures solution — migrate now to avoid timeline worries later. You can override the endpoint by passing an endpoint argument to either client:

from criipto_signatures import CriiptoSignaturesSDKAsync

client = CriiptoSignaturesSDKAsync(
    '{YOUR_CRIIPTO_CLIENT_ID}',
    '{YOUR_CRIIPTO_CLIENT_SECRET}',
    endpoint='https://signatures.idura.app/v1/graphql',
)

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.34.0.tar.gz (546.0 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.34.0-py3-none-any.whl (549.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for criipto_signatures-1.34.0.tar.gz
Algorithm Hash digest
SHA256 8ccbffee99828b37f6e00dd3dc6c96a3af64e4eb7f81e96be192891dc3c2ba53
MD5 0be95581c9cc075f29cb1643df6148fd
BLAKE2b-256 ddf1ce4609be77702e9650fa6c1c144e4550ec4de0b71da79decce0db8e214c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for criipto_signatures-1.34.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d766cd6167d85c83fea57453d921e21f9b42504dc67d178f1de0983ccae469e
MD5 bc2bbaab62beb28082ae3a8d8e690325
BLAKE2b-256 1e3053fd8028cbe74d6e85e83c2cce2abd2a6a06021e4b732144fd6bbc09e137

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