Qopanza.Sdk 0.1.0

Prefix Reserved
dotnet add package Qopanza.Sdk --version 0.1.0
                    
NuGet\Install-Package Qopanza.Sdk -Version 0.1.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="Qopanza.Sdk" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Qopanza.Sdk" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Qopanza.Sdk" />
                    
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 Qopanza.Sdk --version 0.1.0
                    
#r "nuget: Qopanza.Sdk, 0.1.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 Qopanza.Sdk@0.1.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=Qopanza.Sdk&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Qopanza.Sdk&version=0.1.0
                    
Install as a Cake Tool

Qopanza.Sdk (C# / .NET)

C#/.NET client for the Qopanza API. Targets .NET 8, zero third-party runtime dependencies — built on System.Net.Http.HttpClient and System.Text.Json from the BCL only.

Install (local dev)

cd sdks/csharp
dotnet build

To reference it from another .NET project once built, add a project reference to Qopanza.Sdk/Qopanza.Sdk.csproj (a NuGet package hasn't been published yet).

Usage

This SDK covers the crypto/analyze endpoints only — get a real API key by signing up first (account signup isn't part of the SDK yet):

using var http = new HttpClient();
var signupResponse = await http.PostAsJsonAsync("http://localhost:8000/v1/accounts",
    new { email = "you@example.com", password = "a-real-password" });
var signup = await signupResponse.Content.ReadFromJsonAsync<JsonElement>();
var apiKey = signup.GetProperty("api_key").GetString(); // shown once — store it
using Qopanza.Sdk;

using var client = new QopanzaClient("http://localhost:8000", apiKey);

// Generate a KEM keypair
var key = await client.CreateKeyAsync("kem", "order-service-kem");

// Encrypt / decrypt
var enc = await client.EncryptAsync(key.Id, Encoding.UTF8.GetBytes("hello quantum-safe world"));
var plaintext = await client.DecryptAsync(enc);
Console.WriteLine(Encoding.UTF8.GetString(plaintext)); // "hello quantum-safe world"

// Signatures
var sigKey = await client.CreateKeyAsync("signature", "order-service-sig");
var message = Encoding.UTF8.GetBytes("order-42-confirmed");
var signed = await client.SignAsync(sigKey.Id, message);
var valid = await client.VerifyAsync(sigKey.Id, message, signed.Signature);

// AI security analysis
var report = await client.AnalyzeAsync(new { algorithms_in_use = new[] { "RSA-2048" }, key_reuse_count = 3 });
foreach (var finding in report.Findings)
{
    Console.WriteLine($"{finding.Severity} {finding.Title}");
}

Errors from the API surface as QopanzaApiException, carrying StatusCode and ResponseBody:

try
{
    await client.GetKeyAsync("does-not-exist");
}
catch (QopanzaApiException ex)
{
    Console.Error.WriteLine($"{ex.StatusCode}: {ex.ResponseBody}");
}

For advanced scenarios (custom retry/proxy HttpClient configuration, or injecting a fake handler in tests), use the QopanzaClient(HttpClient, string, string?) constructor overload — in that case, disposing the client does not dispose the HttpClient you passed in, since you own its lifetime.

Running the examples and tests

# Quickstart, against a local `docker compose up` stack:
dotnet run --project Qopanza.Sdk.Examples

# Tests — fake the HTTP layer, no live server required:
dotnet test

See Qopanza.Sdk.Examples/Program.cs for the full quickstart and Qopanza.Sdk.Tests/ for the test suite.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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.
  • net8.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
0.1.0 116 9/10/2026