Members on this page
Meshline.Sdk
Meshline.Models.Protocol
AccountDeviceState Class
Contains the complete account-signed list of authorized device certificates at one revision.
public sealed record AccountDeviceState : Meshline.Models.Protocol.TypedProtocolModel, System.IEquatable<Meshline.Models.Protocol.AccountDeviceState>
Inheritance System.Object → ProtocolModel → TypedProtocolModel → AccountDeviceState
Implements System.IEquatable<AccountDeviceState>
Constructors
AccountDeviceState() Constructor
Contains the complete account-signed list of authorized device certificates at one revision.
public AccountDeviceState();
Properties
AccountDeviceState.Account Property
The account's CAIP-10 identifier.
public string Account { get; init; }
Property Value
AccountDeviceState.AccountPublicKey Property
The public key used to verify the account's signature and identifier.
public System.Collections.Immutable.ImmutableArray<byte> AccountPublicKey { get; init; }
Property Value
System.Collections.Immutable.ImmutableArray<System.Byte>
AccountDeviceState.AccountSignature Property
The account signature over the model's account signing input.
public System.Collections.Immutable.ImmutableArray<byte> AccountSignature { get; init; }
Property Value
System.Collections.Immutable.ImmutableArray<System.Byte>
AccountDeviceState.Certificates Property
The device certificates carried by this document or page.
public System.Collections.Immutable.ImmutableArray<Meshline.Models.Protocol.DeviceCertificate> Certificates { get; init; }
Property Value
System.Collections.Immutable.ImmutableArray<DeviceCertificate>
AccountDeviceState.Revision Property
The monotonically increasing revision of the document.
public long Revision { get; init; }
Property Value
Methods
AccountDeviceState.GetNextRevision(Nullable<long>, long) Method
Selects a nonnegative safe-integer revision strictly greater than the known revision.
public static long GetNextRevision(System.Nullable<long> requested, long known);
Parameters
requested System.Nullable<System.Int64>
The explicitly requested revision, or null to increment the known revision.
known System.Int64
The highest known revision; use -1 when no revision is known.
Returns
System.Int64
The requested revision, or the known revision plus one when no revision was supplied.
Exceptions
System.ArgumentOutOfRangeException
The selected revision is negative, exceeds 2^53 - 1, or is not greater than the known revision.
AccountDeviceState.GetSigningInput(NetworkContext) Method
Builds the canonical, network-bound bytes used to sign or verify this document.
public byte[] GetSigningInput(Meshline.Models.NetworkContext context);
Parameters
context NetworkContext
The network context bound into identifiers or signing input.
Returns
System.Byte[]
The canonical UTF-8 signing input bound to the network context, with the applicable signature fields omitted.
Exceptions
System.Text.Json.JsonException
The signing payload cannot be represented as canonical protocol JSON, contains conflicting extension fields, or already contains a root $context property.
AccountDeviceState.Validate(NetworkContext) Method
Validates the complete device set, certificate identities and signatures, and the enclosing account signature.
public override Meshline.Validation.ProtocolViolation? Validate(Meshline.Models.NetworkContext? context);
Parameters
context NetworkContext
The required network context for identity and signature validation.
Returns
ProtocolViolation
The first detected protocol violation, or null if the implemented checks pass.
Exceptions
System.ArgumentNullException
context is null.
System.Security.Cryptography.CryptographicException
The cryptographic provider cannot perform account or relay signature verification; ordinary invalid signatures are returned as protocol violations.
AccountDeviceState.ValidateDeviceAuthorization(string, NetworkContext) Method
Checks that a device is registered in this state and its certificate is currently within its validity window.
public Meshline.Validation.ProtocolViolation? ValidateDeviceAuthorization(string deviceId, Meshline.Models.NetworkContext context);
Parameters
deviceId System.String
The canonical device identifier.
context NetworkContext
The network context bound into identifiers or signing input.
Returns
ProtocolViolation
The first detected protocol violation, or null if the implemented checks pass.
Exceptions
System.Text.Json.JsonException
A certificate cannot be serialized to compute the device identifier.
Remarks
This method checks registration and the current validity window. Validate the enclosing signed device state separately before using it as authorization evidence.