js-crypto-key-utils
Version:
Universal Module for Cryptographic Key Utilities in JavaScript, including PEM-JWK converters
14 lines (13 loc) • 643 B
TypeScript
/**
* thumbprint.js
*/
import { HashTypes, JwkThumbprintFormat } from './typedef';
/**
* Compute JWK public key thumbprint specified in RFC7638
* https://tools.ietf.org/html/rfc7638
* @param {JsonWebKey} jwkey - A key object in JWK format
* @param {HashTypes} [alg='SHA-256'] - Name of hash algorithm to compute the thumbprint.
* @param {JwkThumbprintFormat} [output='binary'] - Output format, 'binary', 'hex' or 'base64'
* @return {Promise<String|Uint8Array>} - The computed JWK thumbprint.
*/
export declare const getJwkThumbprint: (jwkey: JsonWebKey, alg?: HashTypes, output?: JwkThumbprintFormat) => Promise<Uint8Array | string>;