Skip to main content
Table of Contents

Interface IBusEnvelopeSigner

Namespace
Stratara.Abstractions.Messaging
Assembly
Stratara.Abstractions.dll

Computes and verifies opaque signatures over the canonical projection of a bus envelope. Implementations are registered via services.AddBusEnvelopeIntegrity(...); the default is HMAC-SHA256 backed by SharedKey.

public interface IBusEnvelopeSigner
Extension Methods

Remarks

The payload supplied to Sign(string) and Verify(string, string?) is the framework-defined canonical projection of the envelope produced by BusEnvelopeCanonical — a length-prefixed projection of every field of the message except the signature itself, with the command body and the carried events covered as SHA-256 digests. Implementations must not interpret it.

Methods

Sign(string)

Returns an opaque signature string over payload.

string Sign(string payload)

Parameters

payload string

Canonical projection of the envelope as provided by the framework.

Returns

string

A string-encoded signature suitable for embedding in the envelope's Signature field.

Verify(string, string?)

Returns true when signature matches the expected signature for payload. A null or empty signature must return false. Implementations must use a constant-time comparison.

bool Verify(string payload, string? signature)

Parameters

payload string

Canonical projection of the envelope as provided by the framework.

signature string

The signature read off the envelope, or null for an unsigned envelope.

Returns

bool

true if the signature is valid; otherwise false.