Extends
BaseCryptoClass
Constructors
new HmacContext()
new HmacContext(): HmacContext
Returns
HmacContextMethods
sign()
sign(message:Sign a message using the HMAC context.ArrayBuffer):Promise<ArrayBuffer>
Parameters
message
ArrayBuffer
The message to be signed.
Throws
AccessDeniedErrorIf the key lacks the KeyPurpose.SIGN purpose.
Returns
Promise<ArrayBuffer>
Promise<ArrayBuffer> A promise that resolves to the HMAC
signature as an ArrayBuffer.
verify()
verify(message:Verify the authenticity of a message using the HMAC context.ArrayBuffer, tag:ArrayBuffer):Promise<boolean>
Parameters
message
ArrayBuffer
The original message to verify.
tag
ArrayBuffer
The HMAC tag (signature) to verify against the
message.
Throws
AccessDeniedErrorIf the key lacks the KeyPurpose.VERIFY purpose.
Returns
Promise<boolean>
Promise<boolean> A promise that resolves to true if the message
is authentic, false otherwise.
