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

ContentEncryption Class

Describes the algorithm, key, and nonce used to encrypt an attachment.

public sealed record ContentEncryption : Meshline.Models.Protocol.ProtocolModel, System.IEquatable<Meshline.Models.Protocol.ContentEncryption>

Inheritance System.Object → ProtocolModel → ContentEncryption

Implements System.IEquatable<ContentEncryption>

Properties

ContentEncryption.Alg Property

The attachment encryption algorithm identifier, which must be AES-256-GCM.

public string Alg { get; init; }

Property Value

System.String

ContentEncryption.Key Property

The 32-byte AES-256-GCM attachment key; treat it as secret material.

public System.Collections.Immutable.ImmutableArray<byte> Key { get; init; }

Property Value

System.Collections.Immutable.ImmutableArray<System.Byte>

ContentEncryption.Nonce Property

The 12-byte AES-256-GCM nonce used to encrypt the attachment.

public System.Collections.Immutable.ImmutableArray<byte> Nonce { get; init; }

Property Value

System.Collections.Immutable.ImmutableArray<System.Byte>

Methods

ContentEncryption.Validate(NetworkContext) Method

Validates the AES-256-GCM algorithm identifier, key length, and nonce length.

public override Meshline.Validation.ProtocolViolation? Validate(Meshline.Models.NetworkContext? context=null);

Parameters

context NetworkContext

The optional network context; these field checks do not depend on it.

Returns

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