OpenPGP.js v6 adds support for the new version of the OpenPGP specification, RFC 9580. It also increases compliance with the specification, as demonstrated by the OpenPGP interoperability test suite.
OpenPGP.js v6 only makes minor API changes compared to v5.
Here we list a summary of the main changes:
module
(type: module
in package.json), and declares exports, alongside the legacy package.json entrypoints, which should ensure backwards compatibility. Still, bundlers might be affected by the package.json changes depending on how they load the library.SubtleCrypto
(insecure contexts are no longer supported, as SubtleCrypto
is not available there)BigInt
s (not supported by e.g. Safari 13 and below, see full compatibility table)SymEncryptedSessionKeyPacket.s2k?.type === 'argon2'
or SecretKeyPacket|SecretSubkeyPacket.keyPacket.s2k?.type === 'argon2'
.read[Private]Key
: support parsing key blocks (return first parsable key); previously, parsing would fail if a block with more than one key was given in input (https://github.com/openpgpjs/openpgpjs/pull/1755)PrivateKey.getDecryptionKeys
will now throw if no decryption key is found (https://github.com/openpgpjs/openpgpjs/pull/1789). Previously, an empty array was returned. As a consequence of this change, some openpgp.decrypt
errors will be more specific.config.allowMissingKeyFlags
below)config.nonDeterministicSignaturesViaNotation
(defaulting to true) has been added to turn off the feature..v5Keys
flag and encrypted with config.aeadProtect = true
) cannot be decrypted by OpenPGP.js v6 (via decryptKey
) out-of-the-box (see config.parseAEADEncryptedV4KeysAsLegacy
below) (#1672)config.enableParsingV5Entities
below). The affected entities are non-standard, and in the RFC 9580 they have been superseded by v6 keys, v6 signatures and SEIPDv2 encrypted data, respectively. However, generation of v5 entities was supported behind config flags in OpenPGP.js v5, and some other libraries, hence parsing them might be necessary in some cases. (https://github.com/openpgpjs/openpgpjs/pull/1774 , https://github.com/openpgpjs/openpgpjs/pull/1779)config.v5Keys
flag and corresponding key generation. The flag is replaced by .v6Keys
, and results in a different key format.config.aeadProtect
flag has a different effect than in v5:
config.parseAEADEncryptedV4KeysAsLegacy
to allow decrypting AEAD-encrypted v4 keys from OpenPGP.js v5 or older (namely keys generated without .v5Keys
flag and encrypted with config.aeadProtect = true
) (https://github.com/openpgpjs/openpgpjs/pull/1672).config.enableParsingV5Entities
to enable parsing support for v5 entities (https://github.com/openpgpjs/openpgpjs/pull/1774 , https://github.com/openpgpjs/openpgpjs/pull/1779)config.allowMissingKeyFlags
to bypass the missing key flag check (see https://github.com/openpgpjs/openpgpjs/pull/1677)config.minBytesForWebCrypto
, and always use WebCrypto if available, since there is no longer a performance overhead for small messages.enums.publicKey.eddsa
in favour of enums.publicKey.eddsaLegacy
enums.curve.ed25519Legacy
to 'ed25519Legacy'
(was: 'ed25519'
)enums.curve.curve25519Legacy
to 'curve25519Legacy'
(was: 'curve25519'
)config.useIndutnyElliptic
to .useEllipticFallback
, to reflect the change of underlying library.enums.symmetric.plaintext
(internally unused)enums.curve.p256
, .p384
, .p521
are now marked as @deprecated
(to be dropped in the main release)enums.curve.nistP256
, .nistP384
, .nistP521
.'p256'
,'p384'
,'p521'
to 'nistP256'
, 'nistP384'
, 'nistP521'
(these new values are expected by generateKey
, for the options.curve
argument).config.deflateLevel
(https://github.com/openpgpjs/openpgpjs/pull/1717)config.revocationsExpire
, always honor revocation expiration (#1736): the option used to default to false, and ignore revocation expirations. We now honor those expirations, namely match the behavior resulting from setting the option to true.config.preferredHashAlgorithm
) to SHA512 (https://github.com/openpgpjs/openpgpjs/pull/1801)openpgp.sign
, recipientKeys
and recipientUserIDs
options have been added. These can be used to influence the selection of the hash algorithm via the algorithm preferences of the recipient keys, to ensure that the recipients will support the selected hash algorithm. Similarly, when signing+encrypting using openpgp.encrypt
, the encryptionKeys
are now used to determine the preferred hash algorithms, instead of the signingKeys
. (https://github.com/openpgpjs/openpgpjs/pull/1802)Full Changelog: https://github.com/openpgpjs/openpgpjs/compare/v5.11.0...v6.0.0.
For additional context about the changes introduced by OpenPGP.js v6, you can also refer to the changelog of the various prereleases, starting from v6.0.0-alpha.0.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4