MsgP2PCrypto class

Cryptographic services for msgp2p.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

calculateBeaconToken({required Uint8List groupBeaconKey, required int timestampSeconds, int rotationIntervalSeconds = 900}) → Uint8List
Computes the 16-byte anonymous rotating BLE beacon token.
decryptPayload({required Uint8List ciphertextWithMac, required Uint8List secretKey, required Uint8List nonce, required Uint8List aad}) → Future<Uint8List>
Decrypts ciphertextWithMac (with 16-byte Poly1305 tag at the end).
encryptPayload({required Uint8List plaintext, required Uint8List secretKey, required Uint8List nonce, required Uint8List aad}) → Future<Uint8List>
Encrypts plaintext using XChaCha20-Poly1305.
getPublicKeyBytes(SimpleKeyPair keyPair) → Future<Uint8List>
Extracts the 32-byte public key from an Ed25519 keypair.
newKeyPairFromSeed(Uint8List seed) → Future<SimpleKeyPair>
Derives an Ed25519 keypair from a 32-byte seed.
sha256(Uint8List data) → Uint8List
Computes SHA-256 hash.
sign(Uint8List message, SimpleKeyPair keyPair) → Future<Uint8List>
Signs message using an Ed25519 keypair. Returns a 64-byte detached signature.
verifySignature({required Uint8List message, required Uint8List signature, required Uint8List publicKeyBytes}) → Future<bool>
Verifies an Ed25519 signature against message and publicKeyBytes.