UNPKG

did-jwt

Version:

Library for Signing and Verifying JWTs that use DIDs as issuers and JWEs that use DIDs as recipients

27 lines • 986 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const EdDSASigner_js_1 = require("./EdDSASigner.js"); const util_js_1 = require("../util.js"); /** * @deprecated Please use EdDSASigner * * The NaclSigner returns a configured function for signing data using the Ed25519 algorithm. * * The signing function itself takes the data as a `string` or `Uint8Array` parameter and returns a * `base64Url`-encoded signature. * * @example * const signer = NaclSigner(process.env.PRIVATE_KEY) * const data: string = '...' * signer(data).then( (signature: string) => { * ... * }) * * @param {String} base64PrivateKey a 64 byte base64 encoded private key * @return {Function} a configured signer function */ function NaclSigner(base64PrivateKey) { return (0, EdDSASigner_js_1.EdDSASigner)((0, util_js_1.base64ToBytes)(base64PrivateKey)); } exports.default = NaclSigner; //# sourceMappingURL=NaclSigner.js.map