HmacSecretKey class Null safety
Key for signing/verifying with HMAC.
An HmacSecretKey instance holds a symmetric secret key and a Hash, which can be used to create and verify HMAC signatures as specified in FIPS PUB 180-4.
Instances of HmacSecretKey can be imported using HmacSecretKey.importRawKey or generated using HmacSecretKey.generateKey.
- Annotations
Properties
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
Methods
-
exportJsonWebKey(
) → Future< Map< String, dynamic> > - Export HmacSecretKey from JWK.
-
exportRawKey(
) → Future< Uint8List> - Export HmacSecretKey as raw bytes.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
signBytes(
List< int> data) → Future<Uint8List> -
Compute an HMAC signature of given
data
. -
signStream(
Stream< List< data) → Future<int> >Uint8List> -
Compute an HMAC signature of given
data
stream. -
toString(
) → String -
A string representation of this object.
inherited
-
verifyBytes(
List< int> signature, List<int> data) → Future<bool> -
Verify the HMAC
signature
of givendata
. -
verifyStream(
List< int> signature, Stream<List< data) → Future<int> >bool> -
Verify the HMAC
signature
of givendata
stream.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
generateKey(
Hash hash, {int? length}) → Future< HmacSecretKey> -
Generate random
HmacSecretKey
. -
importJsonWebKey(
Map< String, dynamic> jwk, Hash hash, {int? length}) → Future<HmacSecretKey> -
Import
HmacSecretKey
from JWK. -
importRawKey(
List< int> keyData, Hash hash, {int? length}) → Future<HmacSecretKey> -
Import
HmacSecretKey
from rawkeyData
.