SubtleCrypto
The SubtleCrypto
interface provides a number of low-level cryptographic functions. Access to the features of SubtleCrypto
is obtained through the crypto.subtle
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.
Instance properties
This interface doesn't inherit any properties, as it has no parent interface.
Instance methods
This interface doesn't inherit any methods, as it has no parent interface.
SubtleCrypto.digest()
- : Returns a
Promise
that fulfills with a digest generated from the algorithm and text given as parameters.
- : Returns a
Using SubtleCrypto
We can split the functions implemented by this API into two groups: cryptography functions and key management functions.
Cryptography functions
These are the functions you can use to implement security features such as privacy and authentication in a system. The SubtleCrypto
API provides the following cryptography functions:
SubtleCrypto.digest()
: create a fixed-length, collision-resistant digest of some data.