RustCrypto class

All cryptographic operations use the shared Rust native/WASM core.

Constructors

RustCrypto()

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 Properties

isInitialized → bool
no setter

Static Methods

aes256Cbc(List<int> key, List<int> message, {required List<int> iv, bool decrypt = false}) → Uint8List
constantTimeEquals(List<int> a, List<int> b) → bool
encapsulatePin(List<int> peerPublicKey, int version) → Uint8List
Returns SEC1 uncompressed public key (65 bytes), followed by the derived PIN shared secret (32 bytes for v1, 64 for v2). Private key stays in Rust.
hkdfSha256(List<int> key, {required List<int> salt, required List<int> info, int length = 32}) → Uint8List
hmacSha256(List<int> key, List<int> message) → Uint8List
initialize({String? libraryPath, String? wasmModuleUrl}) → Future<void>
Loads the backend once per isolate. Repeated calls require identical options.
packedCertificatePublicKey(String algorithm, List<int> certificate, List<int> aaguid) → Uint8List
Checks the packed leaf certificate profile and AAGUID binding, returning its public key (SEC1 for ES256, raw for Ed25519). Does not establish trust or validate the certificate chain, validity period or revocation status.
randomBytes(int length) → Uint8List
sha256(List<int> message) → Uint8List
sm3(List<int> message) → Uint8List
validatePublicKey(String algorithm, List<int> key) → void
verify(String algorithm, List<int> key, List<int> message, List<int> signature, {String encoding = 'raw', String sm2Id = '1234567812345678', String mlDsaMode = 'pure', List<int> context = const []}) → bool
Low-level Pure ML-DSA permits a context up to 255 bytes. COSE RFC 9964 requires empty context.
verifyHmacSha256(List<int> key, List<int> message, List<int> signature) → bool