静态方法:SubtleCrypto.supports(operation, algorithm[, lengthOrAdditionalAlgorithm])


¥Static method: SubtleCrypto.supports(operation, algorithm[, lengthOrAdditionalAlgorithm])

稳定性: 1.1 - 积极开发

¥Stability: 1.1 - Active development

  • operation <string> "encrypt"、"decrypt"、"sign"、"verify"、"digest"、"generateKey"、"deriveKey"、"deriveBits"、"importKey"、"exportKey"、"getPublicKey"、"wrapKey" 或 "unwrapKey"

    ¥operation <string> "encrypt", "decrypt", "sign", "verify", "digest", "generateKey", "deriveKey", "deriveBits", "importKey", "exportKey", "getPublicKey", "wrapKey", or "unwrapKey"

  • algorithm <string>

  • lengthOrAdditionalAlgorithm <null> | <number> | <string> | <undefined> 根据操作的不同,此选项可以被忽略;操作为 "deriveBits" 时,长度参数的值会被忽略;操作为 "deriveKey" 时,密钥的导出算法会被忽略;操作为 "wrapKey" 时,密钥的封装前导出算法会被忽略;操作为 "unwrapKey" 时,密钥的解封装后导入算法会被忽略。默认值:当操作为 "deriveBits" 时为 null,否则为 undefined

    ¥lengthOrAdditionalAlgorithm <null> | <number> | <string> | <undefined> Depending on the operation this is either ignored, the value of the length argument when operation is "deriveBits", the algorithm of key to be derived when operation is "deriveKey", the algorithm of key to be exported before wrapping when operation is "wrapKey", or the algorithm of key to be imported after unwrapping when operation is "unwrapKey". Default: null when operation is "deriveBits", undefined otherwise.

  • 返回:<boolean> 指示实现是否支持给定操作

    ¥Returns: <boolean> Indicating whether the implementation supports the given operation

允许在 Web Crypto API 中进行功能检测,可用于检测给定操作是否支持给定算法标识符(包括其参数)。

¥Allows feature detection in Web Crypto API, which can be used to detect whether a given algorithm identifier (including its parameters) is supported for the given operation.