Skip to content

Latest commit

 

History

History
87 lines (62 loc) · 2.48 KB

README.md

File metadata and controls

87 lines (62 loc) · 2.48 KB

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 ..."});
}