PostQuantum.SecureChannel.Testing 0.3.0-preview.1

This is a prerelease version of PostQuantum.SecureChannel.Testing.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package PostQuantum.SecureChannel.Testing --version 0.3.0-preview.1
                    
NuGet\Install-Package PostQuantum.SecureChannel.Testing -Version 0.3.0-preview.1
                    
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="PostQuantum.SecureChannel.Testing" Version="0.3.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PostQuantum.SecureChannel.Testing" Version="0.3.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="PostQuantum.SecureChannel.Testing" />
                    
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 PostQuantum.SecureChannel.Testing --version 0.3.0-preview.1
                    
#r "nuget: PostQuantum.SecureChannel.Testing, 0.3.0-preview.1"
                    
#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 PostQuantum.SecureChannel.Testing@0.3.0-preview.1
                    
#: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=PostQuantum.SecureChannel.Testing&version=0.3.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=PostQuantum.SecureChannel.Testing&version=0.3.0-preview.1&prerelease
                    
Install as a Cake Tool

PostQuantum.SecureChannel.Testing

Test helpers for PostQuantum.SecureChannel. Drop into a test project to skip the boilerplate around real transports and identity generation.

dotnet add package PostQuantum.SecureChannel.Testing --version 0.3.0-preview.1

What's included

  • PqInMemoryDuplex — a pair of in-memory Streams connected to each other. No TCP, no sockets, no port allocation. Hand each end to PqSecureChannel.ConnectAsync / AcceptAsync.
  • PqHandshakeHarness — one call returns a client-side and server-side PqSession ready to exchange records. Mutual auth, resumption, and custom PqSessionOptions are all supported via opt-in parameters.
  • PqTestIdentities — generate, reuse, and reset deterministic-looking long-term identities across a fixture without leaking state between tests.
using PostQuantum.SecureChannel.Testing;

// Three lines for a complete client/server session:
using var harness = PqHandshakeHarness.Create();
var ciphertext = harness.Client.Encrypt(Encoding.UTF8.GetBytes("hi"));
Assert.Equal("hi", Encoding.UTF8.GetString(harness.Server.Decrypt(ciphertext)));
// Need a real Stream pair (e.g. for testing the stream adapter)?
var (clientStream, serverStream) = PqInMemoryDuplex.CreatePair();    // replaces TCP/sockets in tests
var clientTask = PqSecureChannel.ConnectAsync(clientStream, clientOptions);
var serverTask = PqSecureChannel.AcceptAsync(serverStream, serverOptions);
await Task.WhenAll(clientTask, serverTask);

Not for production

These helpers are deliberately permissive (e.g. PqInMemoryDuplex does not enforce backpressure the way a real socket does). They are intended for tests; do not use them in production code paths.


To God be the glory.1 Corinthians 10:31

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 is compatible.  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 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.

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.3.0-preview.2 43 6/2/2026
0.3.0-preview.1 48 6/1/2026

0.3.0-preview.1: Initial release of test helpers for PostQuantum.SecureChannel. Provides PqDuplexStream (in-memory pair, no TCP) and PqHandshakeHarness (one-call client/server session pair) so tests stay focused on behavior instead of plumbing.