larabr
c34dede6de
Use \n instead of \r\n for EOL when armoring ( #1183 )
2021-02-09 19:25:20 +01:00
larabr
4efeac3ad1
Unexport low-level key functions ( #1188 )
2021-02-09 19:25:20 +01:00
Daniel Huigens
1f1ffedaf4
[v5] Update asmcrypto.js; fix CI ( #1178 )
2021-02-09 19:25:20 +01:00
Daniel Huigens
2382482090
[v5] Unexport openpgp.util, openpgp.crypto, and low-level types ( #1175 )
2021-02-09 19:25:20 +01:00
larabr
479d826533
Remove armor comment and version by default ( #1170 )
2021-02-09 19:25:20 +01:00
Marco
ad7d654f2b
Fixed description of generateSessionKey ( #1165 )
2021-02-09 19:25:20 +01:00
Dan Ristea
331a0c27a9
Store named signature parameters ( #1158 )
...
Also, remove the now-unnecessary MPI type.
2021-02-09 19:25:20 +01:00
Dan Ristea
d5dd247b2c
Store named session key parameters ( #1157 )
...
Change session key parameter handling to mirror key parameters.
Parameters are stored as an object rather than an array. MPIs are
always stored as Uint8Arrays.
2021-02-09 19:25:20 +01:00
Dan Ristea
400ae63c5e
Fix minor JSDoc and style issues ( #1156 )
2021-02-09 19:25:20 +01:00
Daniel Huigens
b3e08fdc26
Don't export default objects / namespaces
...
Import individual functions, instead.
2021-02-09 19:25:20 +01:00
Daniel Huigens
f276e1ef51
Export key, message, signature, cleartext functions and classes directly
...
Instead of as modules.
Replace *.read with read*, *.readArmored with readArmored*, etc.
Replace cleartext.readArmored with readArmoredCleartextMessage.
Replace message.fromText with Message.fromText, etc.
2021-02-09 19:25:20 +01:00
larabr
3a75eadaa0
Store named key params in key objects ( #1141 )
...
- Store private and public params separately and by name in objects,
instead of as an array
- Do not keep params in MPI form, but convert them to Uint8Arrays when
generating/parsing the key
- Modify low-level crypto functions to always accept and return
Uint8Arrays instead of BigIntegers
- Move PKCS1 padding to lower level functions
2021-02-09 19:25:20 +01:00
larabr
8854b097b4
Use native BigInt when available instead of bn.js ( #1119 )
...
In the lightweight build, lazily load bn.js only when necessary.
Also, use Uint8Arrays instead of strings in PKCS1 padding functions, and
check that the leading zero is present when decoding EME-PKCS1 padding.
2021-02-09 19:25:20 +01:00
Wiktor Kwapisiewicz
fe2949f16d
Allow parsing keys without User IDs ( #1146 )
2021-02-09 19:25:20 +01:00
larabr
8d67af729a
Use higher level functions in key validation tests ( #1128 )
...
Use `key.keyPacket.validate` instead of `crypto.publicKey.validateParams`, see
https://github.com/openpgpjs/openpgpjs/pull/1116#discussion_r447781386 .
Also, `key.decrypt` now only throws on error, no other value is returned.
Also, fix typo (rebase error) that caused tests to fail in Safari for p521.
2021-02-09 19:25:20 +01:00
Dan Ristea
10aa1aa5cb
JSdoc types & ESLint fixes ( #1132 )
2021-02-09 19:25:20 +01:00
larabr
f6ee6e959e
Finish merging key validation
2021-02-09 19:25:20 +01:00
Dan Ristea
b9afd26912
Fix comments on symmetric- and public-key encrypted session keys ( #1120 )
2021-02-09 19:25:20 +01:00
Daniel Huigens
6a607c7567
Rename SymEncryptedAEADProtectedDataPacket to AEADEncryptedDataPacket
2021-02-09 19:25:20 +01:00
Daniel Huigens
17fc32ba51
Appease linter
2021-02-09 19:25:20 +01:00
Daniel Huigens
aea7aa953a
Use ES6 classes
2021-02-09 19:25:20 +01:00
Daniel Huigens
fb3d23427d
Allow dead code elimination
2021-02-09 19:25:20 +01:00
Daniel Huigens
f3b16386dc
Use dynamic import in lightweight build
...
Instead of dynamically loading a <script> tag.
This also removes the non-module lightweight build.
2021-02-09 19:25:20 +01:00
Daniel Huigens
175eac5670
Remove compat polyfills
2021-02-09 19:25:20 +01:00
Daniel Huigens
cde282d4f1
Replace 'global' with 'globalThis'
2021-02-09 19:25:20 +01:00
Daniel Huigens
5b148089c3
Switch to ES8 build of asmcrypto.js
2021-02-09 19:25:20 +01:00
Daniel Huigens
0e33e641af
Switch build system to rollup
...
Also, default to minimized builds.
2021-02-09 19:25:20 +01:00
Daniel Huigens
c48070def6
Remove default export
2021-02-09 19:25:20 +01:00
Ilya Chesnokov
6e648b1cbc
Rename enums to use camelCase ( #1093 )
2021-02-09 19:25:20 +01:00
Ilya Chesnokov
e16807505f
Switch util function names to camelCase ( #1091 )
2021-02-09 19:25:20 +01:00
Ilya Chesnokov
d415bc2546
Rename config option names to camelCase ( #1088 )
2021-02-09 19:25:20 +01:00
larabr
8823603396
Remove worker ( #1072 )
2021-02-09 19:25:20 +01:00
larabr
85d0358d45
Remove 3DES and CAST5 from default preferred symmetric algorithms ( #1068 )
2021-02-09 19:25:20 +01:00
larabr
20950e5df5
Remove SHA-1 from default preferred hash algorithms ( #1067 )
...
Also, remove SHA-1 from the (unused) KDF params constructor defaults.
2021-02-09 19:25:20 +01:00
larabr
5ad19c8da8
Generate ECC keys by default ( #1065 )
...
Also, remove the deprecated numBits options of generateKey in favor of rsaBits.
2021-02-09 19:25:20 +01:00
larabr
4c93abb9f9
Use V5 keys by default ( #1063 )
2021-02-09 19:25:20 +01:00
larabr
a7640bce52
Use AEAD protection by default ( #1062 )
2021-02-09 19:25:20 +01:00
Daniel Huigens
2bc24f354b
Return only one key in key.read[Armored], add readAll[Armored]
2021-02-09 19:25:20 +01:00
Daniel Huigens
3817cca3c6
Throw on unarmored messages with garbage data appended
2021-02-09 19:25:20 +01:00
Daniel Huigens
76a8f11780
Don't mutate key in openpgp.encryptKey/decryptKey
2021-02-09 19:25:20 +01:00
Daniel Huigens
9394fec1f4
Throw in openpgp.initWorker if worker failed to load
2021-02-09 19:25:20 +01:00
Daniel Huigens
35c13212dd
Remove unnecessary calls to convertStreams()
2021-02-09 19:25:20 +01:00
Daniel Huigens
ef7c38860b
Don't unnecessarily return objects in top-level functions
...
openpgp.encrypt, sign, encryptSessionKey, encryptKey and decryptKey now
return their result directly without wrapping it in a "result" object.
Also, remove the `detached` and `returnSessionKey` options of
openpgp.encrypt.
2021-02-09 19:25:20 +01:00
Daniel Huigens
be7b174df4
Add openpgp.generateSessionKey
2021-02-09 19:25:20 +01:00
Daniel Huigens
3a84442b5f
Don't use native streams in old Edge
2021-02-09 19:25:20 +01:00
Daniel Huigens
2fffc76060
Don't overwrite Web Streams Polyfill to globals
...
Instead, use the ponyfill that's now included in web-stream-tools.
Also, convert back to native ReadableStream when we used the ponyfill.
2021-02-09 19:25:20 +01:00
Daniel Huigens
37d30c5003
Return strings in Node streams where appropriate
2021-02-09 19:25:20 +01:00
Daniel Huigens
95eb43a3c2
Return data instead of message in encryptSessionKey
...
Add `armor=true/false` parameter to decide whether `data` is an armored
String or an unarmored Uint8Array.
2021-02-09 19:25:20 +01:00
Daniel Huigens
08d6b276e3
Return data as string in openpgp.verify by default
...
Add format='utf8'/'binary' param to openpgp.verify in order to be able
to return binary data instead.
2021-02-09 19:25:20 +01:00
Daniel Huigens
7225251af8
Return Uint8Array(Stream) instead of object when armor = false
2021-02-09 19:25:20 +01:00