Nip17FileCrypto class

NIP-17 interoperable AES-GCM file encryption.

Sending follows the convention used by Amethyst: AES-256-GCM, a fresh 16-byte nonce, lowercase hex key/nonce tags, and a blob containing ciphertext followed by the 16-byte authentication tag. Decryption also accepts base64url parameters and 12-byte nonces used by older clients.

Constructors

Nip17FileCrypto()

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

decrypt({required Uint8List ciphertext, required Nip17FileMetadata metadata}) Future<Uint8List>
Verifies the encrypted hash before AES-GCM authentication and verifies the original hash after decryption.
encrypt(Uint8List plaintext) Future<Nip17EncryptedFile>
tryDecodeParameter(String value, {Set<int>? allowedLengths}) Uint8List?