UNPKG

@confluentinc/schemaregistry

Version:
31 lines (30 loc) 889 B
/** * Copyright 2020 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { Mac } from './mac'; /** * Implementation of HMAC. * */ export declare class Hmac extends Mac { private readonly hash; private readonly key; private readonly tagSize; /** * @param hash - accepted names are SHA-1, SHA-256 and SHA-512 * @param tagSize - the size of the tag */ constructor(hash: string, key: CryptoKey, tagSize: number); /** */ computeMac(data: Uint8Array<ArrayBuffer>): Promise<Uint8Array<ArrayBuffer>>; /** */ verifyMac(tag: Uint8Array<ArrayBuffer>, data: Uint8Array<ArrayBuffer>): Promise<boolean>; } /** * @param hash - accepted names are SHA-1, SHA-256 and SHA-512 * @param tagSize - the size of the tag */ export declare function fromRawKey(hash: string, key: Uint8Array<ArrayBuffer>, tagSize: number): Promise<Mac>;