Typing for key pair
This commit is contained in:
parent
e86f5a5ad8
commit
9fb2af4d33
1 changed files with 9 additions and 0 deletions
|
|
@ -35,10 +35,19 @@ const isEncryptedMessage = message =>
|
|||
message.mac &&
|
||||
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
|
||||
* when communicating with the deviceId specified
|
||||
* @param {string} deviceId
|
||||
* @returns {Pair}
|
||||
*/
|
||||
const generateKeyPair = deviceId => {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue