ApiValidate class abstract final

Shared argument checks for API validation wrappers. Throws BuError on bad caller input.

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

call<T>(String op, T run()) → T
Runs run for operation op, rethrows BuError/CryptoException, wraps the rest in CryptoException.
digestLength(int digestLength, {int? max, int? min, required String operation, required String name}) → void
Requires digestLength to be non-negative and within min/max, throws BuError otherwise.
length(List<int> data, int expected, {required String operation, required String name}) → void
Requires data to be exactly expected bytes, throws BuError otherwise.
levelMlDsa(int level, String operation) → void
Requires ML-DSA level to be 44, 65, or 87, throws BuError otherwise.
nonEmpty(List<int> data, {required String operation, required String name}) → void
Requires data to be non-empty, throws BuError if empty.
oneOfLengths(List<int> data, List<int> allowed, {required String operation, required String name}) → void
Requires data length to be one of allowed, throws BuError otherwise.