(encryptedMessage, privateKeyArmored)
| 97 | } |
| 98 | |
| 99 | export async function decrypt(encryptedMessage, privateKeyArmored) { |
| 100 | const encryptedMessageMassaged = massagePGP(encryptedMessage) |
| 101 | const privateKey = openpgp.key.readArmored(privateKeyArmored).keys[0] |
| 102 | const passphrase = getPrivateKeyPassphrase(privateKey) |
| 103 | |
| 104 | privateKey.decrypt(passphrase) |
| 105 | |
| 106 | const options = { |
| 107 | message: openpgp.message.readArmored(encryptedMessageMassaged), |
| 108 | privateKey, |
| 109 | } |
| 110 | const plaintext = await openpgp.decrypt(options) |
| 111 | |
| 112 | return plaintext.data |
| 113 | } |
| 114 | |
| 115 | export async function sign(message, privateKeyArmored) { |
| 116 | const privateKey = openpgp.key.readArmored(privateKeyArmored).keys[0] |
nothing calls this directly
no test coverage detected