Skip to content

A dotnet/C# SDK for Criipto Signatures. Sign PAdeS-LTA documents using MitID, BankID or any other eID supported by Criipto.

License

Notifications You must be signed in to change notification settings

criipto/criipto-signatures-dotnet

Repository files navigation

A dotnet/C# SDK for Criipto Signatures

Examples

Getting started

Installation

The SDK is available on Nuget and can be installed using the Package Manager Console or the dotnet CLI:

Install-Package Criipto.Signatures
dotnet add package Criipto.Signatures

Configure the SDK

var client = new CriiptoSignaturesClient("{YOUR_CRIIPTO_CLIENT_ID}", "{YOUR_CRIIPTO_CLIENT_SECRET}");

Basic example

using Criipto.Signatures;
using Criipto.Signatures.Models;

using (var client = new CriiptoSignaturesClient("{YOUR_CRIIPTO_CLIENT_ID}", "{YOUR_CRIIPTO_CLIENT_SECRET}")) {
    // Setup document input
    var documents = new List<DocumentInput>{
        new DocumentInput {
            pdf = new PadesDocumentInput {
                title = "Dotnet Sample",
                blob = pdf,
                storageMode = DocumentStorageMode.Temporary
            }
        }
    };

    // Setup signature order input
    var createSignatureOrderInput = new CreateSignatureOrderInput
    {
        title = "Dotnet Sample",
        documents = documents
    };

    // Create signature order
    var signatureOrder = await client.CreateSignatureOrder(createSignatureOrderInput);

    // Add signatory to signature order
    var addSignatory = await client.AddSignatory(signatureOrder);

    Console.WriteLine(addSignatory.href);

    // ... after signing
    // Close signature order
    var closedSignatureOrder = await client.CloseSignatureOrder(signatureOrder);
}

More examples can be found in the test suite and in the documentation

Methods

QuerySignatureOrder

Will return a Models.SignatureOrder or null if signature order does not exist.

using Criipto.Signatures;

using (var client = new CriiptoSignaturesClient("{YOUR_CRIIPTO_CLIENT_ID}", "{YOUR_CRIIPTO_CLIENT_SECRET}")) {
    var signatureOrder = await client.QuerySignatureOrder("{... signatureOrder id ..."});
}

QuerySignatory

Will return a Models.Signatory or null if signatory does not exist.

using Criipto.Signatures;

using (var client = new CriiptoSignaturesClient("{YOUR_CRIIPTO_CLIENT_ID}", "{YOUR_CRIIPTO_CLIENT_SECRET}")) {
    var signatureOrder = await client.QuerySignatory("{... signatory id ..."});
}

About

A dotnet/C# SDK for Criipto Signatures. Sign PAdeS-LTA documents using MitID, BankID or any other eID supported by Criipto.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published