Table of Contents

Class CryptographicHash

Namespace
EncDotNet.S100.ExchangeSets
Assembly
EncDotNet.S100.ExchangeSets.dll

Represents a parsed S-100 cryptographic hash MRN of the form urn:mrn:iho:s100:hash:<algorithm>:<hex>, used to declare the expected digest of an exchange-set resource so its content integrity can be verified independently of any digital signature.

public sealed class CryptographicHash
Inheritance
CryptographicHash
Inherited Members

Remarks

S-100 Edition 5.2.1 Part 15 §15-8.10, Table 15-12. The MRN namespace is defined by the specification, but a fixed catalogue slot for it is not; ExchangeCatalogueReader therefore discovers it best-effort. All fields are case-insensitive per the specification.

Constructors

CryptographicHash(string, string)

Initializes a new instance of the CryptographicHash class.

public CryptographicHash(string algorithm, string hexValue)

Parameters

algorithm string

The hash algorithm token (e.g. sha256), normalized to lower case.

hexValue string

The computed hash expressed as a lower-case hexadecimal string.

Fields

MrnPrefix

The MRN prefix shared by every S-100 cryptographic hash MRN.

public const string MrnPrefix = "urn:mrn:iho:s100:hash:"

Field Value

string

Properties

Algorithm

The hash algorithm token (e.g. sha256), in lower case.

public string Algorithm { get; }

Property Value

string

HexValue

The expected hash expressed as a lower-case hexadecimal string.

public string HexValue { get; }

Property Value

string

Methods

Matches(string?)

Returns true when candidate matches this declared hash, comparing the hexadecimal value case-insensitively.

public bool Matches(string? candidate)

Parameters

candidate string

A computed hash expressed as a hexadecimal string.

Returns

bool

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

TryParse(string?, out CryptographicHash?)

Attempts to parse an S-100 cryptographic hash MRN (urn:mrn:iho:s100:hash:<algorithm>:<hex>).

public static bool TryParse(string? value, out CryptographicHash? hash)

Parameters

value string

The candidate MRN string (may be null).

hash CryptographicHash

The parsed hash on success; otherwise null.

Returns

bool

true if value is a well-formed hash MRN.

Remarks

S-100 Edition 5.2.1 Part 15 §15-8.10, Table 15-12.