Skip to main content

method SubtleCrypto.supports

#SubtleCrypto.supports(
operation:
"encrypt"
| "decrypt"
| "sign"
| "verify"
| "digest"
| "generateKey"
| "deriveKey"
| "deriveBits"
| "importKey"
| "exportKey"
| "wrapKey"
| "unwrapKey"
| "encapsulateKey"
| "encapsulateBits"
| "decapsulateKey"
| "decapsulateBits"
| "getPublicKey"
,
algorithm: string | object,
lengthOrHash?:
number
| string
| object
| null
,
): boolean

Synchronous feature detection for Web Crypto algorithm/operation combinations, per the WICG "Modern Algorithms in the Web Crypto API" proposal. Returns true when this runtime implements the requested combination, false otherwise.

The third argument is interpreted as the derived-bit length when it is a number (relevant for "deriveBits"), and as a related algorithm — e.g. the derived-key algorithm for "deriveKey", the wrapped/unwrapped key algorithm for "wrapKey" / "unwrapKey", or the shared-key algorithm for "encapsulateKey" / "decapsulateKey" — otherwise.

Parameters #

#operation:
"encrypt"
| "decrypt"
| "sign"
| "verify"
| "digest"
| "generateKey"
| "deriveKey"
| "deriveBits"
| "importKey"
| "exportKey"
| "wrapKey"
| "unwrapKey"
| "encapsulateKey"
| "encapsulateBits"
| "decapsulateKey"
| "decapsulateBits"
| "getPublicKey"
#algorithm: string | object
#lengthOrHash:
number
| string
| object
| null
optional

Return Type #

boolean

See #

Did you find what you needed?

Privacy policy