SecretKey class abstract
An opaque reference to a secret sequence of bytes used for encryption and message authentication.
The bytes of the key may not be in the memory. You can try to extract the bytes with extractBytes, which may throw an error if the bytes are not extractable.
If the secret key is in memory, it's an instance of SecretKeyData. If you no longer need an in-memory secret key, you can optionally call SecretKeyData.destroy. It overwrites the bytes and prevents the key from being used in the future.
- Implementers
Constructors
-
SecretKey(List<
int> bytes, {String? debugLabel}) -
Constructs an instance of SecretKeyData.
factory
- SecretKey.constructor()
- Constructor for subclasses.
-
SecretKey.lazy(Future<
SecretKeyData> f()) -
factory
Properties
- allowDecrypt → bool
-
Whether decryption is allowed with this key.
no setter
- allowEncrypt → bool
-
Whether encryption is allowed with this key.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDestroyed → bool
-
Whether destroy has been called.
no setter
- isExtractable → bool
-
Whether extract will succeed.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
destroy(
) → void - Destroys the secret key.
-
extract(
) → Future< SecretKeyData> - Returns SecretKeyData.
-
extractBytes(
) → Future< List< int> > - Returns bytes of the secret key.
-
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