utils library

Utility layer: config, coding, crypto and payload helpers.

Import this for:

  • Config - the client-side timing knobs (heartbeat/handshake intervals, pending-queue bound), keyed by the server's terminology;
  • Enigma / HkdfEnc - the encrypted handshake, deriving the AES-256 key from the ikm with HKDF-SHA256 (HkdfSha256) and encrypting with AES-256-GCM;
  • registerHmacSha256 - registers the HMAC-SHA256 implementation required by sign() / verify();
  • PayloadMixIn - JSON encode/decode and the handshake payload padding.

Classes

Base64
Config
Configuration for the Magpie Bridge pipe transport.
Enigma
Application secret (enigma) handler: HKDF-SHA256 + AES-256-GCM.
HkdfCipher
Interface for HKDF-SHA256 key derivation + AES-256-GCM encryption: the AES key is derived from the ikm with (salt, info), then the plaintext is encrypted/decrypted with AES-256-GCM (nonce, aad).
HkdfEnc
Encryption context of the encrypted handshake (docs/protocol.md section 6.1).
HkdfSha256
HKDF-SHA256 + AES-256-GCM utility (facade for HkdfCipher).
JSONMap
UTF8

Mixins

PayloadMixIn

Constants

HKDF_SHA256_AES_256_GCM → const String

Functions

registerHmacSha256() → void
Register the default HMAC-SHA256 generator (backed by pointycastle): every constructed link does this automatically - manual calls are only needed for standalone packet-level signing/verification.

Typedefs

SocketAddress = ({InternetAddress host, int port})