did-jwt
Version:
Library for Signing and Verifying JWTs that use DIDs as issuers and JWEs that use DIDs as recipients
18 lines • 859 B
TypeScript
import { Signer } from '../JWT.js';
/**
* Creates a configured signer function for signing data using the ES256K (secp256k1 + 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 = ES256KSigner(process.env.PRIVATE_KEY)
* const signature: string = await sign(data)
* ```
*
* @param {String} privateKey a private key as `Uint8Array`
* @param {Boolean} recoverable an optional flag to add the recovery param to the generated signatures
* @return {Function} a configured signer function `(data: string | Uint8Array): Promise<string>`
*/
export declare function ES256KSigner(privateKey: Uint8Array, recoverable?: boolean): Signer;
//# sourceMappingURL=ES256KSigner.d.ts.map