PostQ.Sdk
0.5.0
dotnet add package PostQ.Sdk --version 0.5.0
NuGet\Install-Package PostQ.Sdk -Version 0.5.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="PostQ.Sdk" Version="0.5.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PostQ.Sdk" Version="0.5.0" />
<PackageReference Include="PostQ.Sdk" />
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 PostQ.Sdk --version 0.5.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: PostQ.Sdk, 0.5.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 PostQ.Sdk@0.5.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=PostQ.Sdk&version=0.5.0
#tool nuget:?package=PostQ.Sdk&version=0.5.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
PostQ.Sdk
Official PostQ SDK for .NET. Submit quantum-risk scans and read results from the PostQ API.
dotnet add package PostQ.Sdk
Quickstart
using PostQ;
using var pq = new PostQClient(new PostQClientOptions
{
ApiKey = Environment.GetEnvironmentVariable("POSTQ_API_KEY")!,
});
// Submit a scan
var result = await pq.Scans.SubmitAsync(new ScanSubmitInput
{
Type = "url",
Target = "example.com",
RiskScore = 85,
RiskLevel = "High",
Findings = new[]
{
new Finding { Severity = "high", Title = "RSA-2048 public key" },
},
});
Console.WriteLine(result.Url); // https://app.postq.dev/scans/...
// List recent scans
var page = await pq.Scans.ListAsync(limit: 10);
foreach (var scan in page.Data)
{
Console.WriteLine($"{scan.Target}\t{scan.RiskLevel}");
}
// Iterate every scan with automatic pagination
await foreach (var scan in pq.Scans.IterAllAsync())
{
// ...
}
// Fetch a full scan record (HNDL, certificate, TLS, normalized findings)
ScanDetail detail = await pq.Scans.GetAsync(result.Id);
Console.WriteLine($"{detail.Hndl?.Severity} cert expires in {detail.Certificate?.DaysUntilExpiry} days");
// Download the CycloneDX 1.6 CBOM for a scan
JsonElement cbom = await pq.Scans.GetCbomAsync(result.Id);
Assets and keys (0.3.0+)
// Browse your cryptographic inventory
var assets = await pq.Assets.ListAsync(new AssetsListInput
{
Provider = "aws",
Risk = "high",
Limit = 50,
});
foreach (var a in assets.Data)
{
Console.WriteLine($"{a.Name}\t{a.Algorithm}\t{a.RiskLevel}");
}
// Or stream every asset
await foreach (var a in pq.Assets.IterAllAsync(new AssetsListInput { Environment = "production" }))
{
// ...
}
// Browse keys discovered by cloud scans
var keys = await pq.Keys.ListAsync(new KeysListInput { Algorithm = "RSA", QuantumVulnerable = true });
foreach (var k in keys.Data)
{
Console.WriteLine($"{k.Provider}\t{k.Region}\t{k.KeyId}\t{k.Algorithm}");
}
Configuration
| Property | Default | Notes |
|---|---|---|
ApiKey |
required | pq_live_… from your dashboard |
BaseUrl |
https://api.postq.dev |
Override for staging or self-hosted |
Timeout |
TimeSpan.FromSeconds(30) |
Per-request timeout |
You can also pass your own HttpClient (useful for IHttpClientFactory integration):
var pq = new PostQClient(options, httpClient);
Errors
All exceptions extend PostQException:
try
{
await pq.Scans.ListAsync();
}
catch (PostQAuthException) { /* 401 */ }
catch (PostQRateLimitException) { /* 429 */ }
catch (PostQException ex) { /* fallback — ex.Status, ex.Code */ }
| Type | When |
|---|---|
PostQConfigException |
Missing/invalid constructor input |
PostQAuthException |
401 |
PostQNotFoundException |
404 |
PostQRateLimitException |
429 |
PostQServerException |
5xx |
PostQNetworkException |
DNS, connection refused, timeout |
PostQException |
Base class |
Requirements
- .NET 8.0+
- Zero runtime dependencies (uses
System.Net.HttpandSystem.Text.Json).
License
MIT — see LICENSE.
| Product | Versions 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.