Crypto
Generated from idl/webcrypto.webidl when the site was built at 7aa23e2.
Crypto is an interface in idl/webcrypto.webidl, exposed in Window, Worker. What it does is on MDN; this page says what niso has of it.
Status
Section titled “Status”The web features its members belong to, each with its Baseline status on the web and how much of the feature’s WPT suite passes in niso (see Web platform support).
| Feature | On the web | In niso | Members |
|---|---|---|---|
| Web Cryptography | Widely available | Partial 74% 52549 of 70571 subtests pass | 3 |
Members
Section titled “Members”getRandomValues()
Section titled “getRandomValues()”ArrayBufferView getRandomValues([NisoMut, NisoIntegerArray] ArrayBufferView array);int32_t niso_crypto_get_random_values(niso_dom* dom, niso_handle self, uint8_t* array, size_t array_len);randomUUID()
Section titled “randomUUID()”DOMString randomUUID();int32_t niso_crypto_random_uuid(niso_dom* dom, niso_handle self, niso_str* out);take()
Section titled “take()”[NisoInternal] static ArrayBuffer take(unsigned long id);int32_t niso_crypto_take(niso_dom* dom, uint32_t id, niso_bytes* out);setSecureContext()
Section titled “setSecureContext()”[NisoInternal] static undefined setSecureContext(boolean secure);int32_t niso_crypto_set_secure_context(niso_dom* dom, bool secure);The binding decided whether its realm is a secure context: the core keeps the decision for the workers the realm starts.
digest()
Section titled “digest()”[NisoInternal] static unsigned long digest(DOMString hash, BufferSource data);int32_t niso_crypto_digest(niso_dom* dom, const char* hash, size_t hash_len, const uint8_t* data, size_t data_len, uint32_t* out);hmac()
Section titled “hmac()”[NisoInternal] static unsigned long hmac(DOMString hash, BufferSource key, BufferSource data);int32_t niso_crypto_hmac(niso_dom* dom, const char* hash, size_t hash_len, const uint8_t* key, size_t key_len, const uint8_t* data, size_t data_len, uint32_t* out);hmacVerify()
Section titled “hmacVerify()”[NisoInternal] static unsigned long hmacVerify(DOMString hash, BufferSource key, BufferSource signature, BufferSource data);int32_t niso_crypto_hmac_verify(niso_dom* dom, const char* hash, size_t hash_len, const uint8_t* key, size_t key_len, const uint8_t* signature, size_t signature_len, const uint8_t* data, size_t data_len, uint32_t* out);aesCtr()
Section titled “aesCtr()”[NisoInternal] static unsigned long aesCtr(BufferSource key, BufferSource counter, unsigned long length, BufferSource data);int32_t niso_crypto_aes_ctr(niso_dom* dom, const uint8_t* key, size_t key_len, const uint8_t* counter, size_t counter_len, uint32_t length, const uint8_t* data, size_t data_len, uint32_t* out);aesCbc()
Section titled “aesCbc()”[NisoInternal] static unsigned long aesCbc(boolean encrypt, BufferSource key, BufferSource iv, BufferSource data);int32_t niso_crypto_aes_cbc(niso_dom* dom, bool encrypt, const uint8_t* key, size_t key_len, const uint8_t* iv, size_t iv_len, const uint8_t* data, size_t data_len, uint32_t* out);aesGcm()
Section titled “aesGcm()”[NisoInternal] static unsigned long aesGcm(boolean encrypt, BufferSource key, BufferSource iv, BufferSource additionalData, unsigned long tagLength, BufferSource data);int32_t niso_crypto_aes_gcm(niso_dom* dom, bool encrypt, const uint8_t* key, size_t key_len, const uint8_t* iv, size_t iv_len, const uint8_t* additional_data, size_t additional_data_len, uint32_t tag_length, const uint8_t* data, size_t data_len, uint32_t* out);aesKw()
Section titled “aesKw()”[NisoInternal] static unsigned long aesKw(boolean wrap, BufferSource key, BufferSource data);int32_t niso_crypto_aes_kw(niso_dom* dom, bool wrap, const uint8_t* key, size_t key_len, const uint8_t* data, size_t data_len, uint32_t* out);pbkdf2()
Section titled “pbkdf2()”[NisoInternal] static unsigned long pbkdf2(DOMString hash, BufferSource password, BufferSource salt, unsigned long iterations, unsigned long length);int32_t niso_crypto_pbkdf2(niso_dom* dom, const char* hash, size_t hash_len, const uint8_t* password, size_t password_len, const uint8_t* salt, size_t salt_len, uint32_t iterations, uint32_t length, uint32_t* out);hkdf()
Section titled “hkdf()”[NisoInternal] static unsigned long hkdf(DOMString hash, BufferSource key, BufferSource salt, BufferSource info, unsigned long length);int32_t niso_crypto_hkdf(niso_dom* dom, const char* hash, size_t hash_len, const uint8_t* key, size_t key_len, const uint8_t* salt, size_t salt_len, const uint8_t* info, size_t info_len, uint32_t length, uint32_t* out);generatePrivate()
Section titled “generatePrivate()”[NisoInternal] static ArrayBuffer generatePrivate(DOMString curve);int32_t niso_crypto_generate_private(niso_dom* dom, const char* curve, size_t curve_len, niso_bytes* out);publicKey()
Section titled “publicKey()”[NisoInternal] static ArrayBuffer publicKey(DOMString curve, BufferSource privateKey);int32_t niso_crypto_public_key(niso_dom* dom, const char* curve, size_t curve_len, const uint8_t* private_key, size_t private_key_len, niso_bytes* out);importPoint()
Section titled “importPoint()”[NisoInternal] static ArrayBuffer importPoint(DOMString curve, BufferSource point);int32_t niso_crypto_import_point(niso_dom* dom, const char* curve, size_t curve_len, const uint8_t* point, size_t point_len, niso_bytes* out);importSpki()
Section titled “importSpki()”[NisoInternal] static ArrayBuffer importSpki(DOMString curve, BufferSource spki);int32_t niso_crypto_import_spki(niso_dom* dom, const char* curve, size_t curve_len, const uint8_t* spki, size_t spki_len, niso_bytes* out);importPkcs8()
Section titled “importPkcs8()”[NisoInternal] static ArrayBuffer importPkcs8(DOMString curve, BufferSource pkcs8);int32_t niso_crypto_import_pkcs8(niso_dom* dom, const char* curve, size_t curve_len, const uint8_t* pkcs8, size_t pkcs8_len, niso_bytes* out);exportSpki()
Section titled “exportSpki()”[NisoInternal] static ArrayBuffer exportSpki(DOMString curve, BufferSource publicKey);int32_t niso_crypto_export_spki(niso_dom* dom, const char* curve, size_t curve_len, const uint8_t* public_key, size_t public_key_len, niso_bytes* out);exportPkcs8()
Section titled “exportPkcs8()”[NisoInternal] static ArrayBuffer exportPkcs8(DOMString curve, BufferSource privateKey);int32_t niso_crypto_export_pkcs8(niso_dom* dom, const char* curve, size_t curve_len, const uint8_t* private_key, size_t private_key_len, niso_bytes* out);sign()
Section titled “sign()”[NisoInternal] static unsigned long sign(DOMString curve, DOMString hash, BufferSource privateKey, BufferSource data);int32_t niso_crypto_sign(niso_dom* dom, const char* curve, size_t curve_len, const char* hash, size_t hash_len, const uint8_t* private_key, size_t private_key_len, const uint8_t* data, size_t data_len, uint32_t* out);verify()
Section titled “verify()”[NisoInternal] static unsigned long verify(DOMString curve, DOMString hash, BufferSource publicKey, BufferSource signature, BufferSource data);int32_t niso_crypto_verify(niso_dom* dom, const char* curve, size_t curve_len, const char* hash, size_t hash_len, const uint8_t* public_key, size_t public_key_len, const uint8_t* signature, size_t signature_len, const uint8_t* data, size_t data_len, uint32_t* out);agree()
Section titled “agree()”[NisoInternal] static ArrayBuffer agree(DOMString curve, BufferSource privateKey, BufferSource publicKey);int32_t niso_crypto_agree(niso_dom* dom, const char* curve, size_t curve_len, const uint8_t* private_key, size_t private_key_len, const uint8_t* public_key, size_t public_key_len, niso_bytes* out);rsaGenerate()
Section titled “rsaGenerate()”[NisoInternal] static unsigned long rsaGenerate(unsigned long modulusLength, BufferSource publicExponent);int32_t niso_crypto_rsa_generate(niso_dom* dom, uint32_t modulus_length, const uint8_t* public_exponent, size_t public_exponent_len, uint32_t* out);RSA keys are DER: a public key’s SubjectPublicKeyInfo, a private key’s PrivateKeyInfo.
rsaPublicKey()
Section titled “rsaPublicKey()”[NisoInternal] static ArrayBuffer rsaPublicKey(BufferSource privateKey);int32_t niso_crypto_rsa_public_key(niso_dom* dom, const uint8_t* private_key, size_t private_key_len, niso_bytes* out);rsaImport()
Section titled “rsaImport()”[NisoInternal] static ArrayBuffer rsaImport(BufferSource key, boolean isPrivate);int32_t niso_crypto_rsa_import(niso_dom* dom, const uint8_t* key, size_t key_len, bool is_private, niso_bytes* out);rsaComponents()
Section titled “rsaComponents()”[NisoInternal] static ArrayBuffer rsaComponents(BufferSource key, boolean isPrivate);int32_t niso_crypto_rsa_components(niso_dom* dom, const uint8_t* key, size_t key_len, bool is_private, niso_bytes* out);rsaFromComponents()
Section titled “rsaFromComponents()”[NisoInternal] static ArrayBuffer rsaFromComponents(BufferSource n, BufferSource e, BufferSource d, BufferSource p, BufferSource q, BufferSource dp, BufferSource dq, BufferSource qi);int32_t niso_crypto_rsa_from_components(niso_dom* dom, const uint8_t* n, size_t n_len, const uint8_t* e, size_t e_len, const uint8_t* d, size_t d_len, const uint8_t* p, size_t p_len, const uint8_t* q, size_t q_len, const uint8_t* dp, size_t dp_len, const uint8_t* dq, size_t dq_len, const uint8_t* qi, size_t qi_len, niso_bytes* out);rsaSign()
Section titled “rsaSign()”[NisoInternal] static unsigned long rsaSign(DOMString scheme, DOMString hash, BufferSource privateKey, unsigned long saltLength, BufferSource data);int32_t niso_crypto_rsa_sign(niso_dom* dom, const char* scheme, size_t scheme_len, const char* hash, size_t hash_len, const uint8_t* private_key, size_t private_key_len, uint32_t salt_length, const uint8_t* data, size_t data_len, uint32_t* out);rsaVerify()
Section titled “rsaVerify()”[NisoInternal] static unsigned long rsaVerify(DOMString scheme, DOMString hash, BufferSource publicKey, unsigned long saltLength, BufferSource signature, BufferSource data);int32_t niso_crypto_rsa_verify(niso_dom* dom, const char* scheme, size_t scheme_len, const char* hash, size_t hash_len, const uint8_t* public_key, size_t public_key_len, uint32_t salt_length, const uint8_t* signature, size_t signature_len, const uint8_t* data, size_t data_len, uint32_t* out);rsaOaep()
Section titled “rsaOaep()”[NisoInternal] static unsigned long rsaOaep(boolean encrypt, DOMString hash, BufferSource key, BufferSource label, BufferSource data);int32_t niso_crypto_rsa_oaep(niso_dom* dom, bool encrypt, const char* hash, size_t hash_len, const uint8_t* key, size_t key_len, const uint8_t* label, size_t label_len, const uint8_t* data, size_t data_len, uint32_t* out);Not in niso yet
Section titled “Not in niso yet”Members the web has, by the BCD keys web-features 3.45.0 lists, that idl/ doesn’t declare. The list is partial: web-features lists only the keys it maps to a feature.
subtle(Web Cryptography)