UNPKG

did-jwt

Version:

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

17 lines 722 B
import { Signer } from '../JWT.js'; /** * Creates a configured signer function for signing data using the ES256 (secp256r1 + sha256) algorithm. * * The signing function itself takes the data as a `Uint8Array` or `string` and returns a `base64Url`-encoded signature * * @example * ```typescript * const sign: Signer = ES256Signer(process.env.PRIVATE_KEY) * const signature: string = await sign(data) * ``` * * @param {String} privateKey a private key as `Uint8Array` * @return {Function} a configured signer function `(data: string | Uint8Array): Promise<string>` */ export declare function ES256Signer(privateKey: Uint8Array): Signer; //# sourceMappingURL=ES256Signer.d.ts.map