UNPKG

@relaycorp/webcrypto-kms

Version:

WebCrypto-compatible client for Key Management Services like GCP KMS

14 lines 618 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.hash = exports.derDeserialisePublicKey = void 0; const webcrypto_1 = require("@peculiar/webcrypto"); const NODEJS_CRYPTO = new webcrypto_1.Crypto(); function derDeserialisePublicKey(publicKeySerialized, algorithm) { return NODEJS_CRYPTO.subtle.importKey('spki', publicKeySerialized, algorithm, true, ['verify']); } exports.derDeserialisePublicKey = derDeserialisePublicKey; async function hash(input, algorithm) { return NODEJS_CRYPTO.subtle.digest(algorithm, input); } exports.hash = hash; //# sourceMappingURL=crypto.js.map