Zamane 0.1.2

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

Zamane

NuGet NuGet Downloads

A small, dependency-free client library for KamuSM's Zamane timestamp service. ASN.1 work is done with the built-in System.Formats.Asn1 API, so there are no external NuGet dependencies.

Install

dotnet add package Zamane

API

Type Responsibility
IdentityGenerator customerNo + password + hash → DER-encoded hex identity
TimeStampRequestParser TimeStampReqmessageImprint.hashedMessage
TimeStampClient HTTP POST + identity header → Zamane TimeStampResp

Quick start

using Zamane;

using var http = new HttpClient();
var client = new TimeStampClient(
    TimeStampClient.TestBaseUrl, // or .ProductionBaseUrl
    http);

byte[] tsr = await client.RequestTimestampAsync(
    customerNo:   "12345",
    password:     "secret",
    timeStampReq: tsReqBytes);

await File.WriteAllBytesAsync("token.tsr", tsr);

tsReqBytes must be a DER-encoded RFC 3161 TimeStampReq. Build one with BouncyCastle (or any other ASN.1 toolkit) before calling the client.

Client options

Pass a TimeStampClientOptions to override defaults. Set RegenerateNonce = true to have the client rewrite the nonce field of the supplied TimeStampReq with a fresh cryptographically random value on every request (useful when the same DER-encoded request is reused):

var client = new TimeStampClient(
    TimeStampClient.TestBaseUrl,
    http,
    new TimeStampClientOptions { RegenerateNonce = true });

RegenerateNonce defaults to false, in which case the request is sent verbatim.

Building an identity directly

using System.Numerics;
using Zamane;

string identity = IdentityGenerator.CreateIdentity(
    customerNo: BigInteger.Parse("12345"),
    password:   "secret",
    hashValue:  hashBytes);

// Override iteration count, salt, IV:
string identity2 = IdentityGenerator.CreateIdentity(
    customerNo: 42,
    password:   "secret",
    hashValue:  hashBytes,
    iterations: 10_000,
    salt:       saltBytes, // 8 bytes
    iv:         ivBytes);  // 16 bytes

The hex string decodes to:

SEQUENCE {
  INTEGER       customerNo,
  OCTET STRING  salt        (8 bytes),
  INTEGER       iterations,
  OCTET STRING  iv          (16 bytes),
  OCTET STRING  ciphertext
}

Reading hashedMessage from a TimeStampReq

using Zamane;

byte[] hashedMessage = TimeStampRequestParser.GetHashedMessage(tsReqBytes);

// or from a hex string:
byte[] hashedMessage2 = TimeStampRequestParser.GetHashedMessage(tsReqHex);

Using IHttpClientFactory

services.AddHttpClient<TimeStampClient>(c =>
{
    c.BaseAddress = new Uri(TimeStampClient.ProductionBaseUrl);
    c.Timeout     = TimeSpan.FromSeconds(30);
});

TimeStampClient accepts a base URL and an optional HttpClient. In DI scenarios, prefer passing a shared HttpClient instance.

Product 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 was computed.  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 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 netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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.1.2 118 5/18/2026
0.1.1 121 5/9/2026
0.1.0 110 5/8/2026