HmacKeyGenParams

Draft
This page is not complete.

Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

This dictionary represents the object that should be passed as the algorithm parameter into SubtleCrypto.generateKey(), when generating a key for the HMAC algorithm.

Properties

name
DOMString. This should be set to "HMAC".
hash

DOMString. The name of the digest function to use. You can pass any of "SHA-1, "SHA-256", "SHA-384", or "SHA-512" here.

length Optional

Number. 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

Specifications

Specification Status Comment
Web Cryptography API
The definition of 'SubtleCrypto.HmacKeyGenParams' in that specification.
Recommendation  

Browser compatibility

No compatibility data found. Please contribute data for "api.SubtleCrypto.encrypt.algorithm-hmac" (depth: 1) to the MDN compatibility data repository.

Document Tags and Contributors

Contributors to this page: rugk, wbamberg
Last updated by: rugk,