UNPKG

@pushforge/builder

Version:

A robust, cross-platform Web Push notification library that handles VAPID authentication and payload encryption following the Web Push Protocol standard. Works in Node.js 16+, Browsers, Deno, Bun and Cloudflare Workers.

14 lines (13 loc) 783 B
/** * Derives a shared secret from a client's public key and a local private key using the ECDH algorithm. * * This function uses the Web Crypto API to derive a shared secret, which can then be used * for further cryptographic operations, such as key derivation using HKDF. * * @param {CryptoKey} clientPublicKey - The public key of the client, used to derive the shared secret. * @param {CryptoKey} localPrivateKey - The local private key used in the derivation process. * @returns {Promise<CryptoKey>} A promise that resolves to a CryptoKey representing the derived shared secret. * * @throws {Error} Throws an error if the key derivation fails. */ export declare const deriveSharedSecret: (clientPublicKey: CryptoKey, localPrivateKey: CryptoKey) => Promise<CryptoKey>;