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
Methods
Equals(HardwareId?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(HardwareId? other)
Parameters
otherHardwareIdAn object to compare with this object.
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
FromBytes(ReadOnlySpan<byte>)
Creates a hardware id from 16 raw bytes.
public static HardwareId FromBytes(ReadOnlySpan<byte> value)
Parameters
valueReadOnlySpan<byte>Exactly 16 bytes.
Returns
- HardwareId
The hardware id.
Exceptions
- ArgumentException
valueis 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
hexstringA 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()