| Crates.io | deno_crypto |
| lib.rs | deno_crypto |
| version | 0.231.0 |
| created_at | 2020-10-14 14:56:09.501662+00 |
| updated_at | 2025-09-24 20:04:59.766938+00 |
| description | Web Cryptography API implementation for Deno |
| homepage | |
| repository | https://github.com/denoland/deno |
| max_upload_size | |
| id | 299659 |
| size | 332,934 |
This crate implements the Web Cryptography API.
Spec: https://www.w3.org/TR/WebCryptoAPI/
From javascript, include the extension's source, and assign CryptoKey,
crypto, Crypto, and SubtleCrypto to the global scope:
import * as crypto from "ext:deno_crypto/00_crypto.js";
Object.defineProperty(globalThis, "CryptoKey", {
value: crypto.CryptoKey,
enumerable: false,
configurable: true,
writable: true,
});
Object.defineProperty(globalThis, "crypto", {
value: crypto.crypto,
enumerable: false,
configurable: true,
writable: false,
});
Object.defineProperty(globalThis, "Crypto", {
value: crypto.Crypto,
enumerable: false,
configurable: true,
writable: true,
});
Object.defineProperty(globalThis, "SubtleCrypto", {
value: crypto.SubtleCrypto,
enumerable: false,
configurable: true,
writable: true,
});
Then from rust, provide: deno_crypto::deno_crypto::init(Option<u64>) in the
extensions field of your RuntimeOptions
Where the Option<u64> represents an optional seed for initialization.
deno_webidl cratedeno_web crateFollowing ops are provided, which can be accessed through Deno.ops: