451-tools
Version:
Censorship resilient and distributed publishing: informed by the needs of publishers and their audiences, More Mirrors implements a set of offline fallback strategies for censorship resilient websites.
16 lines (15 loc) • 907 B
TypeScript
/**
* Verifies the provided signature for the given parameters using the ECDSA public key.
* @param {object} params - The parameters that were signed.
* @param {string} signature - The hexadecimal-encoded signature to verify.
* @param {string} base64PublicKey - The public key in Base64 encoding (SPKI format).
* @returns {Promise<boolean>} `true` if the signature is valid, `false` otherwise.
*/
export function verifySignature(params: object, signature: string, base64PublicKey: string): Promise<boolean>;
/**
* Retrieves the public key used for verifying signatures.
* @param {string} base64PublicKey - The public key in Base64 encoding (SPKI format).
* @returns {Promise<CryptoKey>} The imported public key object for the ECDSA algorithm.
* - The public key is expected to be Base64 encoded and formatted in SPKI.
*/
export function getPublicKey(base64PublicKey: string): Promise<CryptoKey>;