fork-openpgpjs/test/general
larabr 0654bbe505
Remove Key.prototype.encrypt() and Key.prototype.decrypt() (#1285)
To encrypt/decrypt a key, the top-level functions `openpgp.encryptKey` and
`openpgp.decryptKey` should be used instead: these don't mutate the key;
instead, they either return a new encrypted/decrypted key object or throw an
error.

With `Key.prototype.encrypt` and `decrypt`, which mutated the key, it was
possible to end up in an inconsistent state if some (sub)keys could be
decrypted but others couldn't, they would both mutate the key and throw an
error, which is unexpected.

Note that the `keyID` parameter is not supported by `encryptKey`/`decryptKey`,
since partial key decryption is not recommended. If you still need to decrypt
a single subkey or primary key `k`, you can call `k.keyPacket.decrypt(...)`,
followed by `k.keyPacket.validate(...)`. Similarly, for encryption, call
`k.keyPacket.encrypt(...)`.

Additionally, `openpgp.generateKey` now requires `options.userIDs` again,
since otherwise the key is basically unusable. This was a regression from v4,
since we now allow parsing keys without user IDs (but still not using them).
2021-04-23 15:43:38 +02:00
..
armor.js Consolidate read* functions (#1236) 2021-02-17 20:36:33 +01:00
biginteger.js Lint all tests (#1235) 2021-02-12 23:00:22 +01:00
brainpool.js Remove Key.prototype.encrypt() and Key.prototype.decrypt() (#1285) 2021-04-23 15:43:38 +02:00
config.js Replace Message.fromText and Message.fromBinary with createMessage 2021-03-26 10:56:02 +01:00
decompression.js Consolidate read* functions (#1236) 2021-02-17 20:36:33 +01:00
ecc_nist.js Replace Message.fromText and Message.fromBinary with createMessage 2021-03-26 10:56:02 +01:00
ecc_secp256k1.js Remove Key.prototype.encrypt() and Key.prototype.decrypt() (#1285) 2021-04-23 15:43:38 +02:00
index.js Remove KeyRing class 2021-03-01 11:58:10 +01:00
key.js Remove Key.prototype.encrypt() and Key.prototype.decrypt() (#1285) 2021-04-23 15:43:38 +02:00
oid.js Lint all tests (#1235) 2021-02-12 23:00:22 +01:00
openpgp.js Remove Key.prototype.encrypt() and Key.prototype.decrypt() (#1285) 2021-04-23 15:43:38 +02:00
packet.js Remove Key.prototype.encrypt() and Key.prototype.decrypt() (#1285) 2021-04-23 15:43:38 +02:00
signature.js Remove Key.prototype.encrypt() and Key.prototype.decrypt() (#1285) 2021-04-23 15:43:38 +02:00
streaming.js Remove Key.prototype.encrypt() and Key.prototype.decrypt() (#1285) 2021-04-23 15:43:38 +02:00
testInputs.js Store named key params in key objects (#1141) 2021-02-09 19:25:20 +01:00
util.js Use consistent name casing (#1268) 2021-03-25 19:56:59 +01:00
x25519.js Remove Key.prototype.encrypt() and Key.prototype.decrypt() (#1285) 2021-04-23 15:43:38 +02:00