Typing for key pair

This commit is contained in:
Daniel Lugo 2021-12-13 08:22:04 -04:00
parent e86f5a5ad8
commit 9fb2af4d33

View file

@ -35,10 +35,19 @@ const isEncryptedMessage = message =>
message.mac && message.mac &&
message.ephemPublicKey message.ephemPublicKey
/**
* @typedef {object} Pair
* @prop {Buffer} privateKey
* @prop {Buffer} publicKey
* @prop {string} privateKeyBase64
* @prop {string} publicKeyBase64
*/
/** /**
* Generates a new encryption key pair that will be used * Generates a new encryption key pair that will be used
* when communicating with the deviceId specified * when communicating with the deviceId specified
* @param {string} deviceId * @param {string} deviceId
* @returns {Pair}
*/ */
const generateKeyPair = deviceId => { const generateKeyPair = deviceId => {
try { try {