Lacuna.Cloudhub 1.0.0

dotnet add package Lacuna.Cloudhub --version 1.0.0
                    
NuGet\Install-Package Lacuna.Cloudhub -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Lacuna.Cloudhub" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lacuna.Cloudhub" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Lacuna.Cloudhub" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Lacuna.Cloudhub --version 1.0.0
                    
#r "nuget: Lacuna.Cloudhub, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Lacuna.Cloudhub@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Lacuna.Cloudhub&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Lacuna.Cloudhub&version=1.0.0
                    
Install as a Cake Tool

<div align="center"> <img src="assets/nuget-icon.png" alt="Lacuna Cloudhub .NET SDK" width="112" /> <h1>Lacuna Cloudhub .NET SDK</h1> <p><strong>Cloud certificate discovery, authentication, and signing through a strongly typed .NET client.</strong></p> <p>Use the Lacuna Cloudhub API without hand-written HTTP requests, with generated models, async methods, source-generated JSON serialization, and <code>X-Api-Key</code> authentication.</p>

NuGet CI License: MIT .NET 10 </div>


Features

  • Complete v1 Swagger coverage — service discovery, availability, session creation, certificate retrieval, hash signing, and custom state.
  • Strongly typed contracts — request/response models and enums generated from Cloudhub's official OpenAPI document.
  • API key authentication — every operation sends the credential in the X-Api-Key header.
  • Modern .NET — async APIs, nullable annotations, source-generated System.Text.Json, trimming analysis, assembly signing, and reproducible packages.
  • Reproducible generation — the pinned AutoSDK version plus deterministic OpenAPI overrides produce stable operation names and authentication metadata.

This community SDK is maintained by loud-technology and generated from Lacuna Software's public Cloudhub OpenAPI specification. It is not an official Lacuna Software SDK.

Requirements

  • .NET 10 SDK or later to build
  • A Lacuna Cloudhub API key

Install

dotnet add package Lacuna.Cloudhub

Quick start

Keep the credential outside source control:

export LACUNA_CLOUDHUB_API_KEY="your-cloudhub-api-key"

Then discover available trust services for a CPF:

using Loud.Technology.Lacuna.Cloudhub.Sdk;

using var client = CloudhubClient.CreateFromEnvironment();

var services = await client.GetServicesAsync(
    identifier: "12345678901",
    identifierType: IdentifierTypes.Cpf);

foreach (var service in services)
{
    Console.WriteLine($"{service.ServiceName} — {service.Provider}");
}

Create a single-signature session:

var session = await client.CreateSessionAsync(
    redirectUri: "https://app.example.com/cloudhub/callback",
    identifierType: IdentifierTypes.Cpf,
    identifier: "12345678901",
    type: TrustServiceSessionTypes.SingleSignature,
    lifetimeInSeconds: 300,
    customState: "order-42",
    discover: true);

var authorizationUrl = session.Services?.FirstOrDefault()?.AuthUrl;

Configure the client

Explicit credential

using var client = new CloudhubClient("your-cloudhub-api-key");

Custom endpoint and application-managed HttpClient

using var httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(30) };
using var client = new CloudhubClient(
    apiKey: Environment.GetEnvironmentVariable("LACUNA_CLOUDHUB_API_KEY")!,
    httpClient: httpClient,
    baseUri: new Uri("https://cloudhub.lacunasoftware.com"),
    disposeHttpClient: false);
Variable Purpose Default
LACUNA_CLOUDHUB_API_KEY Value sent in the X-Api-Key header Required by CreateFromEnvironment()
LACUNA_CLOUDHUB_BASE_URL Cloudhub API base URL https://cloudhub.lacunasoftware.com

Never commit API keys. Use environment variables, .NET user secrets, or a cloud secret manager.

API surface

Method Cloudhub endpoint
GetServicesAsync GET /api/sessions/services
GetServiceAvailabilityAsync GET /api/sessions/services/{name}/availability
CreateSessionAsync POST /api/sessions
CreateServiceSessionAsync POST /api/sessions/services/{name}
GetCertificateAsync GET /api/sessions/certificate
GetCertificateV2Async GET /api/v2/sessions/certificate
SignHashAsync POST /api/sessions/sign-hash
GetCustomStateAsync GET /api/sessions/custom-state

Every method accepts a CancellationToken. Methods ending in AsResponseAsync expose status and headers. Non-success responses throw ApiException; generated typed subclasses include authentication, authorization, validation, rate-limit, and server exceptions.

Regenerate

cd src/libs/Cloudhub
./generate.sh

The script downloads the official Swagger document, applies deterministic fixes for missing operation IDs and global security, and replaces Generated/ using AutoSDK 0.30.2-dev.152.

Build and test

dotnet restore Loud.Technology.Lacuna.Cloudhub.Sdk.slnx
dotnet build Loud.Technology.Lacuna.Cloudhub.Sdk.slnx --configuration Release --no-restore
dotnet test Loud.Technology.Lacuna.Cloudhub.Sdk.slnx --configuration Release --no-build

Network-free contract tests verify the default URL, X-Api-Key header, routes, enum/query serialization, typed responses, byte-array handling, and model validation.

License

Licensed under the MIT License.

Acknowledgments

JetBrains logo

This project is supported by JetBrains through the Open Source Support Program.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 1,850 8/17/2026