SubtleCrypto class
Secure context: This feature is available only in secure
contexts (HTTPS), in some or all supporting browsers.
The interface of the Web Crypto API provides a number of
low-level cryptographic functions. Access to the features of is
obtained through the subtle
property of the Crypto object you
get from the crypto
property.
Warning: This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. Errors in security system design and implementation can make the security of the system completely ineffective. Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The Crypto 101 Course can be a great place to start learning about the design and implementation of secure systems.
- Available extensions
- Annotations
-
- @JS()
- @staticInterop
Constructors
- SubtleCrypto()
-
factory
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
-
decrypt(
dynamic algorithm, CryptoKey key, dynamic data) → Future -
Available on SubtleCrypto, provided by the PropsSubtleCrypto extension
-
deriveBits(
dynamic algorithm, CryptoKey baseKey, int length) → Future< ByteBuffer> -
Available on SubtleCrypto, provided by the PropsSubtleCrypto extension
-
deriveKey(
dynamic algorithm, CryptoKey baseKey, dynamic derivedKeyType, bool extractable, Iterable< KeyUsage> keyUsages) → Future -
Available on SubtleCrypto, provided by the PropsSubtleCrypto extension
-
digest(
dynamic algorithm, dynamic data) → Future -
Available on SubtleCrypto, provided by the PropsSubtleCrypto extension
-
encrypt(
dynamic algorithm, CryptoKey key, dynamic data) → Future -
Available on SubtleCrypto, provided by the PropsSubtleCrypto extension
-
exportKey(
KeyFormat format, CryptoKey key) → Future -
Available on SubtleCrypto, provided by the PropsSubtleCrypto extension
-
generateKey(
dynamic algorithm, bool extractable, Iterable< KeyUsage> keyUsages) → Future -
Available on SubtleCrypto, provided by the PropsSubtleCrypto extension
-
importKey(
KeyFormat format, dynamic keyData, dynamic algorithm, bool extractable, Iterable< KeyUsage> keyUsages) → Future<CryptoKey> -
Available on SubtleCrypto, provided by the PropsSubtleCrypto extension
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sign(
dynamic algorithm, CryptoKey key, dynamic data) → Future -
Available on SubtleCrypto, provided by the PropsSubtleCrypto extension
-
toString(
) → String -
A string representation of this object.
inherited
-
unwrapKey(
KeyFormat format, dynamic wrappedKey, CryptoKey unwrappingKey, dynamic unwrapAlgorithm, dynamic unwrappedKeyAlgorithm, bool extractable, Iterable< KeyUsage> keyUsages) → Future<CryptoKey> -
Available on SubtleCrypto, provided by the PropsSubtleCrypto extension
-
verify(
dynamic algorithm, CryptoKey key, dynamic signature, dynamic data) → Future -
Available on SubtleCrypto, provided by the PropsSubtleCrypto extension
-
wrapKey(
KeyFormat format, CryptoKey key, CryptoKey wrappingKey, dynamic wrapAlgorithm) → Future -
Available on SubtleCrypto, provided by the PropsSubtleCrypto extension
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited