mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2025-06-30 18:12:30 +00:00

- `openpgp.generateKey`, `reformatKey` and `revokeKey` take a new `format` option, whose possible values are: `'armor', 'binary', 'object'` (default is `'armor'`). - `generateKey` and `reformatKey` now return an object of the form `{ publicKey, privateKey, revocationCertificate }`, where the type of `publicKey` and `privateKey` depends on `options.format`: * if `format: 'armor'` then `privateKey, publicKey` are armored strings; * if `format: 'binary'` then `privateKey, publicKey` are `Uint8Array`; * if `format: 'object'` then `privateKey, publicKey` are `PrivateKey` and `PublicKey` objects respectively; - `revokeKey` now returns `{ publicKey, privateKey }`, where: * if a `PrivateKey` is passed as `key` input, `privateKey, publicKey` are of the requested format; * if a `PublicKey` is passed as `key` input, `publicKey` is of the requested format, while `privateKey` is `null` (previously, in this case the `privateKey` field was not defined). Breaking changes: - In `revokeKey`, if no `format` option is specified, the returned `publicKey, privateKey` are armored strings (they used to be objects). - In `generateKey` and `reformatKey`, the `key` value is no longer returned. - For all three functions, the `publicKeyArmored` and `privateKeyArmored` values are no longer returned.