NATS.NKeys
1.0.0-preview.1
Prefix Reserved
See the version list below for details.
dotnet add package NATS.NKeys --version 1.0.0-preview.1
NuGet\Install-Package NATS.NKeys -Version 1.0.0-preview.1
<PackageReference Include="NATS.NKeys" Version="1.0.0-preview.1" />
<PackageVersion Include="NATS.NKeys" Version="1.0.0-preview.1" />
<PackageReference Include="NATS.NKeys" />
paket add NATS.NKeys --version 1.0.0-preview.1
#r "nuget: NATS.NKeys, 1.0.0-preview.1"
#:package NATS.NKeys@1.0.0-preview.1
#addin nuget:?package=NATS.NKeys&version=1.0.0-preview.1&prerelease
#tool nuget:?package=NATS.NKeys&version=1.0.0-preview.1&prerelease
NKeys .NET
NKeys is a public-key signature system based on Ed25519 for the NATS ecosystem.
Usage
Create a new key pair:
// Create a new key pair for a user
KeyPair keyPair = KeyPair.CreatePair(PrefixByte.User);
// Get the seed
// Output example (your seed will be different):
// Seed: SUAOBFVHF4ZWKTBJ6QP4C362WLBBBFIE7ENFTPYKUGZ3M2ESOXY353LXDI
string seed = keyPair.GetSeed();
Console.WriteLine($"Seed: {seed}");
// Get the public key
// Output example (your public key will be different):
// Public key: UBIWK4X3RXCPJ4CMIAVLAFDFABMLCCMZDDLAO5OZZ2265MDLXUTOGO4B
string publicKey = keyPair.GetPublicKey();
Console.WriteLine($"Public key: {publicKey}");
Sign and verify a message:
// Using already generated seed and public key
var seed = "SOAELH6NJCEK4HST5644G4HK7TOAFZGRRJHNM4EUKUY7PPNDLIKO5IH4JM";
var publicKey = "ODPWIBQJVIQ42462QAFI2RKJC4RZHCQSIVPRDDHWFCJAP52NRZK6Z2YC";
// Create a key pair from seed
KeyPair pair1 = KeyPair.FromSeed(seed);
Assert.Equal(seed, pair1.GetSeed());
Assert.Equal(publicKey, pair1.GetPublicKey());
// Create a key pair from public key
KeyPair pair2 = KeyPair.FromPublicKey(publicKey);
Assert.Equal(publicKey, pair2.GetPublicKey());
// Sign and verify
var message = new ReadOnlyMemory<byte>([42, 43, 44]);
var signature = new Memory<byte>(new byte[64]);
pair1.Sign(message, signature);
Assert.True(pair2.Verify(message, signature));
// Verify fails with corrupt data
var corrupt = new ReadOnlyMemory<byte>([43, 44]);
Assert.False(pair2.Verify(corrupt, signature));
About
A public-key signature system based on Ed25519 for the NATS ecosystem.
See also https://github.com/nats-io/nkeys
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Memory (>= 4.5.4)
-
net8.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on NATS.NKeys:
| Package | Downloads |
|---|---|
|
NATS.Client.Core
Core client for NATS, the high-performance cloud-native messaging system. Provides async pub/sub, request-reply, and queue groups for .NET applications. |
|
|
NATS.Jwt
JWT token library for the NATS messaging ecosystem. Create and encode operator, account, and user JWTs signed with NKeys for NATS decentralized authentication and authorization. |
|
|
CosmoBroker
High-performance messaging engine with NATS support, optional native AMQP 0-9-1 support for RabbitMQ-style workloads, and SQL-backed persistence. |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on NATS.NKeys:
| Repository | Stars |
|---|---|
|
nats-io/nats.net
Async .NET client for NATS: pub/sub, request/reply, JetStream, KV, Object Store, Services
|
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.2 | 1,136 | 4/10/2026 |
| 1.0.1 | 2,978 | 4/7/2026 |
| 1.0.0 | 2,803 | 3/17/2026 |
| 1.0.0-preview.3 | 72,046 | 4/2/2025 |
| 1.0.0-preview.2 | 4,998 | 2/10/2025 |
| 1.0.0-preview.1 | 18,879 | 5/21/2024 |