JTigerNova.jtiger.security 1.0.0

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

jtiger.security

.NET Standard 2.0 library of shared security primitives for JTiger Nova.

Currently: Ed25519 signing and validation of share-protected media URLs, so the signer and the media-server validator run one implementation instead of two that can drift apart.

Renamed from Business.Lib.Service.JTigerNova.Security. The namespace is now jtiger.security.

Signed media URLs

A signed URL carries two query params:

Param Meaning
exp Absolute expiry, Unix seconds
sig base64url Ed25519 signature

Only the path is signed - the canonical string is "<urlPath>|<exp>" - so unrelated query params (cache busters, tracking, resize hints) never invalidate a link.

API

public static class SignedMediaUrl
{
    public const string ParamExp = "exp";
    public const string ParamSig = "sig";

    public static string Canonical(string urlPath, long expUnixSeconds);
    public static string Sign(string urlPath, long expUnixSeconds, string privateKeyBase64Url);

    public static bool Validate(string urlPath, string exp, string sig, long nowUnixSeconds,
        int skewSeconds, IEnumerable<string> publicKeysBase64Url);

    public static string GeneratePrivateKey();
    public static string PublicKeyFromPrivate(string privateKeyBase64Url);
    public static string KeyId(string publicKeyBase64Url);

    public static string Base64UrlEncode(byte[] bytes);
    public static byte[] Base64UrlDecode(string value);
}

Signing

var exp = DateTimeOffset.UtcNow.AddMinutes(15).ToUnixTimeSeconds();
var sig = SignedMediaUrl.Sign("/media/protected/abc.jpg", exp, privateKey);

var url = $"/media/protected/abc.jpg?{SignedMediaUrl.ParamExp}={exp}&{SignedMediaUrl.ParamSig}={sig}";

Validating

var ok = SignedMediaUrl.Validate(
    urlPath:             request.Url.AbsolutePath,
    exp:                 request.QueryString[SignedMediaUrl.ParamExp],
    sig:                 request.QueryString[SignedMediaUrl.ParamSig],
    nowUnixSeconds:      DateTimeOffset.UtcNow.ToUnixTimeSeconds(),
    skewSeconds:         60,
    publicKeysBase64Url: activePublicKeys);

Validate takes a collection of public keys so a rotation can accept the outgoing and incoming key at once. skewSeconds tolerates clock drift between the signer and the validator.

Any malformed input - unparseable exp, non-base64url sig, wrong-length signature or key - returns false rather than throwing. Sign, PublicKeyFromPrivate, and KeyId do throw on a malformed key, since that is a configuration error rather than untrusted request data.

Keys

var priv = SignedMediaUrl.GeneratePrivateKey();      // base64url 32-byte seed - keep secret
var pub  = SignedMediaUrl.PublicKeyFromPrivate(priv); // base64url 32-byte public key - publishable
var id   = SignedMediaUrl.KeyId(pub);                 // base64url SHA-256 thumbprint

Dependencies

  • BouncyCastle.Cryptography

License

MIT License - Copyright 2026 JTiger Nova

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 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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on JTigerNova.jtiger.security:

Package Downloads
JTigerNova.Web.Lib.Service.JTigerNova

Library of standard web service functions and support

JTigerNova.Web.Lib.Website.JTigerNova

Standard website operations

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 70 8/10/2026

v1.0.0:
- SignedMediaUrl: Ed25519 signing and validation for share-protected media urls
 - signs "<urlPath>|<exp>" so unrelated query params never invalidate a link
 - validation against one or more public keys for key rotation
 - base64url helpers and public-key derivation for key publishing
- renamed from Business.Lib.Service.JTigerNova.Security (namespace is now jtiger.security)