Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. HmacImportParams

HmacImportParams

TheHmacImportParams dictionary of theWeb Crypto API represents the object that should be passed when importing, unwrapping, or deriving a key for theHMAC algorithm, as:

Instance properties

name

A string. This should be set toHMAC.

hash

A string or an object containing a single property calledname with a string value. It is an identifier for thedigest algorithm to use. This should be one of the following:

  • SHA-256: selects theSHA-256 algorithm.
  • SHA-384: selects theSHA-384 algorithm.
  • SHA-512: selects theSHA-512 algorithm.

Warning:SHA-1 is also supported here but theSHA-1 algorithm is considered vulnerable and should no longer be used.

lengthOptional

ANumber representing the length in bits of the key. If this is omitted the length of the key is equal to the length of the digest generated by the digest function you have chosen. Unless you have a good reason to use a different length, omit this property and use the default.

Examples

See the examples forSubtleCrypto.importKey(),SubtleCrypto.unwrapKey(), orSubtleCrypto.deriveKey().

Specifications

Specification
Web Cryptography Level 2
# dfn-HmacImportParams

Browser compatibility

Browsers that support the "HMAC" algorithm for theSubtleCrypto.importKey(),SubtleCrypto.unwrapKey(), orSubtleCrypto.deriveKey() methods will support this type.

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp