Class AuditIntegrityLink
Represents one append-only hash-chain link for a canonical audit or outbox record hash.
public sealed class AuditIntegrityLink
- Inheritance
-
AuditIntegrityLink
- Inherited Members
Remarks
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
CanonicalizationVersion
Gets the canonicalization version used for link hashing.
public string CanonicalizationVersion { get; }
Property Value
ChainId
Gets the logical chain identifier.
public string ChainId { get; }
Property Value
CreatedUtc
Gets the UTC timestamp when this link was created.
public DateTimeOffset CreatedUtc { get; }
Property Value
HashAlgorithm
Gets the hash algorithm used for record and link hashes.
public string HashAlgorithm { get; }
Property Value
IsGenesis
Gets a value indicating whether this is the first link in the chain.
public bool IsGenesis { get; }
Property Value
LinkHash
Gets this link's canonical hash.
public string LinkHash { get; }
Property Value
Metadata
Gets provider-neutral metadata associated with the link.
public IReadOnlyDictionary<string, string> Metadata { get; }
Property Value
PreviousLinkHash
Gets the previous link hash. Genesis links use an empty value.
public string PreviousLinkHash { get; }
Property Value
RecordHash
Gets the canonical record hash bound into this link.
public string RecordHash { get; }
Property Value
RecordId
Gets the record identifier bound into this link.
public string RecordId { get; }
Property Value
RecordType
Gets the canonical record artifact type bound into this link.
public string RecordType { get; }
Property Value
SchemaVersion
Gets the schema version for the integrity link.
public string SchemaVersion { get; }
Property Value
Sequence
Gets the one-based sequence number within the chain.
public long Sequence { get; }
Property Value
Methods
Append(AuditIntegrityLink, CanonicalPayloadHash, DateTimeOffset, IReadOnlyDictionary<string, string>?)
Appends a link after the supplied previous link.
public static AuditIntegrityLink Append(AuditIntegrityLink previousLink, CanonicalPayloadHash recordHash, DateTimeOffset createdUtc, IReadOnlyDictionary<string, string>? metadata = null)
Parameters
previousLinkAuditIntegrityLinkrecordHashCanonicalPayloadHashcreatedUtcDateTimeOffsetmetadataIReadOnlyDictionary<string, string>
Returns
ComputeExpectedLinkHash()
Recomputes the link hash from the persisted link fields.
public string ComputeExpectedLinkHash()
Returns
CreateGenesis(string, CanonicalPayloadHash, DateTimeOffset, IReadOnlyDictionary<string, string>?)
Creates the first link in a chain.
public static AuditIntegrityLink CreateGenesis(string chainId, CanonicalPayloadHash recordHash, DateTimeOffset createdUtc, IReadOnlyDictionary<string, string>? metadata = null)
Parameters
chainIdstringrecordHashCanonicalPayloadHashcreatedUtcDateTimeOffsetmetadataIReadOnlyDictionary<string, string>
Returns
Rehydrate(string, long, string, string, string, string, string, string, string, string, DateTimeOffset, IReadOnlyDictionary<string, string>?)
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
chainIdstringsequencelongrecordIdstringrecordTypestringrecordHashstringpreviousLinkHashstringlinkHashstringhashAlgorithmstringcanonicalizationVersionstringschemaVersionstringcreatedUtcDateTimeOffsetmetadataIReadOnlyDictionary<string, string>