Skip to content
Meshline
SDK 1.1.0 · TypeView source on GitHub

Developer guide · API index

Members on this page

Meshline.Sdk

Meshline.Models.Protocol

Identifiers Class

Derives, creates, and validates device, group, channel, message, and invitation identifiers.

public static class Identifiers

Inheritance System.Object → Identifiers

Remarks

Identifier validation checks representation rules. It does not verify signatures or establish current authorization.

Methods

Identifiers.CreateInviteId() Method

Creates a canonical group invitation identifier using 16 cryptographically random bytes.

public static string CreateInviteId();

Returns

System.String
A new inv_-prefixed canonical base64url identifier.

Exceptions

System.Security.Cryptography.CryptographicException
The cryptographic random-number provider cannot generate the identifier bytes.

Identifiers.CreateMessageId() Method

Creates a canonical message identifier using 16 cryptographically random bytes.

public static string CreateMessageId();

Returns

System.String
A new msg_-prefixed canonical base64url identifier.

Exceptions

System.Security.Cryptography.CryptographicException
The cryptographic random-number provider cannot generate the identifier bytes.

Identifiers.DeriveChannelId(string, string, ReadOnlySpan<byte>, NetworkContext) Method

Derives a channel identifier from its creator, hosting relay, creation nonce, and network context.

public static string DeriveChannelId(string creator, string relayId, System.ReadOnlySpan<byte> nonce, Meshline.Models.NetworkContext context);

Parameters

creator System.String

The creator's CAIP-10 account identifier.

relayId System.String

The relay's canonical lowercase Neo script-hash identifier.

nonce System.ReadOnlySpan<System.Byte>

The 16-byte resource creation nonce.

context NetworkContext

The network context bound into identifiers or signing input.

Returns

System.String
The canonical network-bound channel identifier.

Exceptions

System.ArgumentException
nonce does not contain exactly 16 bytes.

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.

Identifiers.DeriveDeviceId(DeviceCertificate, NetworkContext) Method

Derives the device identifier from the account, device public keys, and network context.

public static string DeriveDeviceId(Meshline.Models.Protocol.DeviceCertificate certificate, Meshline.Models.NetworkContext context);

Parameters

certificate DeviceCertificate

The certificate supplying the account and device public keys.

context NetworkContext

The network context bound into identifiers or signing input.

Returns

System.String
The canonical network-bound device identifier.

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.

Identifiers.DeriveGroupId(string, string, ReadOnlySpan<byte>, NetworkContext) Method

Derives a group identifier from its creator, hosting relay, creation nonce, and network context.

public static string DeriveGroupId(string creator, string relayId, System.ReadOnlySpan<byte> nonce, Meshline.Models.NetworkContext context);

Parameters

creator System.String

The creator's CAIP-10 account identifier.

relayId System.String

The relay's canonical lowercase Neo script-hash identifier.

nonce System.ReadOnlySpan<System.Byte>

The 16-byte resource creation nonce.

context NetworkContext

The network context bound into identifiers or signing input.

Returns

System.String
The canonical network-bound group identifier.

Exceptions

System.ArgumentException
nonce does not contain exactly 16 bytes.

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.

Identifiers.ValidateChannelId(string) Method

Checks the prefix, size, and canonical base64url encoding of a channel identifier.

public static Meshline.Validation.ProtocolViolation? ValidateChannelId(string channelId);

Parameters

channelId System.String

The canonical channel identifier.

Returns

ProtocolViolation
The first detected protocol violation, or null if the implemented checks pass.

Identifiers.ValidateDeviceId(string) Method

Checks the prefix, size, and canonical base64url encoding of a device identifier.

public static Meshline.Validation.ProtocolViolation? ValidateDeviceId(string deviceId);

Parameters

deviceId System.String

The canonical device identifier.

Returns

ProtocolViolation
The first detected protocol violation, or null if the implemented checks pass.

Identifiers.ValidateGroupId(string) Method

Checks the prefix, size, and canonical base64url encoding of a group identifier.

public static Meshline.Validation.ProtocolViolation? ValidateGroupId(string groupId);

Parameters

groupId System.String

The canonical group identifier.

Returns

ProtocolViolation
The first detected protocol violation, or null if the implemented checks pass.

Identifiers.ValidateInviteId(string) Method

Checks the prefix, size, and canonical base64url encoding of a group invitation identifier.

public static Meshline.Validation.ProtocolViolation? ValidateInviteId(string inviteId);

Parameters

inviteId System.String

The canonical group invitation identifier.

Returns

ProtocolViolation
The first detected protocol violation, or null if the implemented checks pass.

Identifiers.ValidateMessageId(string) Method

Checks the prefix, size, and canonical base64url encoding of a message identifier.

public static Meshline.Validation.ProtocolViolation? ValidateMessageId(string messageId);

Parameters

messageId System.String

The canonical message identifier.

Returns

ProtocolViolation
The first detected protocol violation, or null if the implemented checks pass.