Table of Contents

Class HardwareId

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

A 16-byte (128-bit) hardware identifier (HW_ID) assigned by an OEM to an end-user system. The hardware id is the key with which a Data Server wraps the per-product cell keys delivered in a DataPermit.

public sealed class HardwareId : IEquatable<HardwareId>
Inheritance
HardwareId
Implements
Inherited Members

Remarks

S-100 Edition 5.2.1 Part 15 ยง15-7.3.1.1. The hardware id is exactly one AES block, so it is wrapped/unwrapped with a single-block encryption that needs no padding.

Properties

Value

The 16 raw bytes of the hardware id.

public ReadOnlySpan<byte> Value { get; }

Property Value

ReadOnlySpan<byte>

Methods

Equals(HardwareId?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(HardwareId? other)

Parameters

other HardwareId

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

FromBytes(ReadOnlySpan<byte>)

Creates a hardware id from 16 raw bytes.

public static HardwareId FromBytes(ReadOnlySpan<byte> value)

Parameters

value ReadOnlySpan<byte>

Exactly 16 bytes.

Returns

HardwareId

The hardware id.

Exceptions

ArgumentException

value is not 16 bytes.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Parse(string)

Parses a hardware id from its 32-character hexadecimal representation.

public static HardwareId Parse(string hex)

Parameters

hex string

A 32-character hexadecimal string (case-insensitive).

Returns

HardwareId

The hardware id.

Exceptions

FormatException

The string is not 32 hexadecimal characters.

ToString()

Returns the upper-case 32-character hexadecimal representation.

public override string ToString()

Returns

string