Table of Contents

Class AuditIntegrityLink

Namespace
AsiBackbone.Core.Integrity
Assembly
AsiBackbone.Core.dll

Represents one append-only hash-chain link for a canonical audit or outbox record hash.

public sealed class AuditIntegrityLink
Inheritance
AuditIntegrityLink
Inherited Members

A link proves only local sequence continuity when later verified. It does not make storage immutable, externally anchored, or legally non-repudiable by itself.

Properties

Gets the canonicalization version used for link hashing.

public string CanonicalizationVersion { get; }

Property Value

string

Gets the logical chain identifier.

public string ChainId { get; }

Property Value

string

Gets the UTC timestamp when this link was created.

public DateTimeOffset CreatedUtc { get; }

Property Value

DateTimeOffset

Gets the hash algorithm used for record and link hashes.

public string HashAlgorithm { get; }

Property Value

string

Gets a value indicating whether this is the first link in the chain.

public bool IsGenesis { get; }

Property Value

bool

Gets this link's canonical hash.

public string LinkHash { get; }

Property Value

string

Gets provider-neutral metadata associated with the link.

public IReadOnlyDictionary<string, string> Metadata { get; }

Property Value

IReadOnlyDictionary<string, string>

Gets the previous link hash. Genesis links use an empty value.

public string PreviousLinkHash { get; }

Property Value

string

Gets the canonical record hash bound into this link.

public string RecordHash { get; }

Property Value

string

Gets the record identifier bound into this link.

public string RecordId { get; }

Property Value

string

Gets the canonical record artifact type bound into this link.

public string RecordType { get; }

Property Value

string

Gets the schema version for the integrity link.

public string SchemaVersion { get; }

Property Value

string

Gets the one-based sequence number within the chain.

public long Sequence { get; }

Property Value

long

Methods

Appends a link after the supplied previous link.

public static AuditIntegrityLink Append(AuditIntegrityLink previousLink, CanonicalPayloadHash recordHash, DateTimeOffset createdUtc, IReadOnlyDictionary<string, string>? metadata = null)

Parameters

previousLink AuditIntegrityLink
recordHash CanonicalPayloadHash
createdUtc DateTimeOffset
metadata IReadOnlyDictionary<string, string>

Returns

AuditIntegrityLink

Recomputes the link hash from the persisted link fields.

public string ComputeExpectedLinkHash()

Returns

string

Creates the first link in a chain.

public static AuditIntegrityLink CreateGenesis(string chainId, CanonicalPayloadHash recordHash, DateTimeOffset createdUtc, IReadOnlyDictionary<string, string>? metadata = null)

Parameters

chainId string
recordHash CanonicalPayloadHash
createdUtc DateTimeOffset
metadata IReadOnlyDictionary<string, string>

Returns

AuditIntegrityLink

Rehydrates a persisted link without recomputing its link hash.

public static AuditIntegrityLink Rehydrate(string chainId, long sequence, string recordId, string recordType, string recordHash, string previousLinkHash, string linkHash, string hashAlgorithm, string canonicalizationVersion, string schemaVersion, DateTimeOffset createdUtc, IReadOnlyDictionary<string, string>? metadata = null)

Parameters

chainId string
sequence long
recordId string
recordType string
recordHash string
previousLinkHash string
linkHash string
hashAlgorithm string
canonicalizationVersion string
schemaVersion string
createdUtc DateTimeOffset
metadata IReadOnlyDictionary<string, string>

Returns

AuditIntegrityLink