webcrypto library Null safety
Cryptographic primitives for use on Dart VM and Dart in the browser.
TODO: Finish documentation of a public identifiers, so far the folliwng items have been documented:
Exceptions
This library will throw the following exceptions:
- FormatException, if input data could not be parsed.
Errors
This library will throw the following errors:
- ArgumentError, when an parameter is out of range,
- UnsupportedError, when an operation isn't supported,
- OperationError, when an operation fails operation specific reason, this typically when the underlying cryptographic library returns an error.
Mapping Web Crypto Error
SyntaxError
becomes ArgumentError,QuotaExceededError
becomes ArgumentError,NotSupportedError
becomes UnsupportedError,DataError
becomes FormatException,OperationError
becomes OperationError,InvalidAccessError
shouldn't occur, except for ECDH key derivation with mismatching curves where it becomes an ArgumentError.
Classes
- AesCbcSecretKey
- AES secret key for symmetric encryption and decryption using AES in Cipher Block Chaining mode (CBC-mode), as described in NIST SP800-38A.
- AesCtrSecretKey
- AesGcmSecretKey
- EcdhPrivateKey
- EcdhPublicKey
- EcdsaPrivateKey
- EcdsaPublicKey
- Hash
- A cryptographic hash algorithm implementation.
- HkdfSecretKey
- HmacSecretKey
- Key for signing/verifying with HMAC.
-
KeyPair<
S, T> - A key-pair as returned from key generation.
- Pbkdf2SecretKey
- RsaOaepPrivateKey
- RsaOaepPublicKey
- RsaPssPrivateKey
- RsaPssPublicKey
- RsassaPkcs1V15PrivateKey
- RSASSA-PKCS1-v1_5 private key for signing messages.
- RsassaPkcs1V15PublicKey
- RSASSA-PKCS1-v1_5 public key for signing messages.
Functions
-
fillRandomBytes(
TypedData destination) → void -
Fill
destination
with cryptographically random values.
Enums
- EllipticCurve
- Elliptic curves supported by ECDSA and ECDH.
Exceptions / Errors
- OperationError
- Thrown when an operation failed for an operation-specific reason.