DartHmac class
An implementation of Hmac in pure Dart.
For examples and more information about the algorithm, see documentation for the superclass Hmac.
- Inheritance
-
- Object
- MacAlgorithm
- Hmac
- DartHmac
- Mixed-in types
Constructors
- DartHmac(HashAlgorithm hashAlgorithm)
-
const
- DartHmac.blake2b()
-
HMAC-BLAKE2B.
factory
- DartHmac.blake2s()
-
HMAC-BLAKE2S.
factory
- DartHmac.sha1()
-
HMAC-SHA1.
factory
- DartHmac.sha224()
-
HMAC-SHA224.
factory
- DartHmac.sha256()
-
HMAC-SHA256.
factory
- DartHmac.sha384()
-
HMAC-SHA384.
factory
- DartHmac.sha512()
-
HMAC-SHA512.
factory
Properties
- hashAlgorithm → HashAlgorithm
-
Hash algorithm used by this HMAC.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- keyStreamUsed → int
-
Number of bytes in key stream used to initialize the MAC algorithm.
no setterinherited
- macLength → int
-
Number of bytes in the message authentication code.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- supportsAad → bool
-
Whether the algorithm supports Associated Authenticated Data (AAD).
no setterinherited
- supportsKeyStreamIndex → bool
-
Whether the algorithm supports key stream index.
no setterinherited
Methods
-
afterData(
) → void -
inherited
-
beforeData(
{required SecretKeyData secretKey, required List< int> nonce, List<int> aad = const []}) → void -
inherited
-
calculateMac(
List< int> bytes, {required SecretKey secretKey, List<int> nonce = const <int>[], List<int> aad = const <int>[]}) → Future<Mac> -
Calculates message authentication code.
inherited
-
calculateMacSync(
List< int> bytes, {required SecretKeyData secretKeyData, required List<int> nonce, List<int> aad = const <int>[]}) → Mac -
Computes a MAC synchronously (unlike calculateMac).
inherited
-
checkParameters(
{int? length, required SecretKey secretKey, required int nonceLength, required int aadLength, required int keyStreamIndex}) → void -
Checks parameters and throws ArgumentError if they are invalid.
inherited
-
newMacSink(
{required SecretKey secretKey, List< int> nonce = const <int>[], List<int> aad = const <int>[]}) → Future<DartMacSinkMixin> -
Constructs a sink for calculating a Mac.
inherited
-
newMacSinkSync(
{required SecretKeyData secretKeyData, List< int> nonce = const <int>[], List<int> aad = const <int>[]}) → DartMacSinkMixin -
Returns DartMacSinkMixin, which can be used synchronously.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
toSync(
) → DartHmac -
Returns a synchronous implementation of this algorithm.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited