Skip to content

Update AAuth .NET SDK research plan with available security/encryption libraries #3

@dasiths

Description

@dasiths

Background

The research plan for the .NET AAuth SDK and samples (see .agent/plans/2026-05-13-dotnet-aauth-sdk/research.md) currently calls for several cryptographic and protocol components to be hand-implemented, including RFC 9421 HTTP Message Signatures, Ed25519 JWT support, JSON canonicalization, JWKS hosting, JWK thumbprints, etc. However, as of mid-2026, several high-quality .NET libraries now cover these key needs and can significantly reduce custom code.

Findings

Key .NET libraries that should update the current plan's implementation approach:

RFC 9421 HTTP Message Signatures

  • NSign: Complete, actively maintained RFC 9421 HTTP Message Signature implementation
    • NuGet: NSign.Abstractions, NSign.SignatureProviders, NSign.Client, NSign.AspNetCore, NSign.BouncyCastle
    • Ed25519 (EdDSA) support via BouncyCastle extension
    • DelegatingHandler and ASP.NET middleware ready-to-use
  • Only AAuth-specific Signature-Key header extensions need light custom code

Ed25519 (EdDSA) JWT signing

  • jose-jwt: Ed25519 JWT support, full JWK/JWS/JWE implementation
  • ScottBrady.IdentityModel.EdDsa: Adds EdDSA signature provider wiring to Microsoft.IdentityModel
  • (Microsoft.IdentityModel.Tokens does not natively support Ed25519 yet)

JSON Canonicalization (RFC 8785)

JWK Thumbprint, JWK/JWKS Handling

Ed25519 Core Crypto

What Still Needs Custom Code

  • AAuth-specific logic: the Signature-Key header extensions (sig=jwt, sig=hwk, etc), AAuth headers (AAuth-Requirement, etc), protocol mechanics, mission/r3, etc.

Suggested Next Steps

  1. Update the research plan:
    • Adjust all sections (esp. 5.2, 6, 10, 12) to recommend leveraging these libraries and eliminating custom RFC 9421/JWT/JSON/JWK/JWKS implementations.
    • Narrow in on only AAuth-specific protocol code for custom work.
  2. (Optional) Add issue/prioritized todo items to refactor or stub out planned sections to "wrap/integrate these libraries."

For reference/libraries table:

Functionality Library
RFC 9421 HTTP signatures NSign (+NSign.BouncyCastle for Ed25519)
RFC 8785 Canonicalization JsonCanonicalizer
JWT Ed25519 signing jose-jwt, ScottBrady.IdentityModel.EdDsa
JWK/JWK Thumbprint Microsoft.IdentityModel.Tokens
JWKS endpoint/rotation NetDevPack.Security.Jwt, Jwks.Manager
Ed25519 Core Crypto NSec.Cryptography, Portable.BouncyCastle

Impact

This will focus development effort on the protocol and application-specific parts of the AAuth .NET SDK/samples and save substantial effort.


References:

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions