deno.com
method SubtleCrypto.exportKey
#SubtleCrypto.exportKey(
format: "jwk",
key: CryptoKey,
): Promise<JsonWebKey>

Exports a cryptographic key in JSON Web Key (JWK) format.

This method allows exporting an asymmetric key (e.g., RSA, ECDSA) into a JSON-based representation, making it easy to store and transfer across systems.

Examples #

#
await crypto.subtle.exportKey("jwk", key);

Parameters #

#format: "jwk"

Return Type #

Promise<JsonWebKey>

See #

#SubtleCrypto.exportKey(
format: Exclude<KeyFormat, "jwk">,
key: CryptoKey,
): Promise<ArrayBuffer>

Exports a cryptographic key in raw, PKCS8, or SPKI format.

This method is used to export symmetric keys (AES), private keys (PKCS8), or public keys (SPKI) in binary form.

Examples #

#
await crypto.subtle.exportKey("raw", key);

Parameters #

#format: Exclude<KeyFormat, "jwk">

Return Type #

Promise<ArrayBuffer>

See #