mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2025-03-30 15:08:32 +00:00
Compare commits
486 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
88310fe69d | ||
![]() |
c2526c8a88 | ||
![]() |
1848f51a4c | ||
![]() |
4762d2c762 | ||
![]() |
d5689894f6 | ||
![]() |
6d4a86295e | ||
![]() |
8a2062d342 | ||
![]() |
e9fe979649 | ||
![]() |
1ab6f27fc9 | ||
![]() |
a7660cc43b | ||
![]() |
b583bcad23 | ||
![]() |
a3a9e06802 | ||
![]() |
965e63b672 | ||
![]() |
96b13a468b | ||
![]() |
432856ff0e | ||
![]() |
b2bd8a0fdd | ||
![]() |
6db98f1e47 | ||
![]() |
8e5da78971 | ||
![]() |
a5d894f514 | ||
![]() |
a16160fc66 | ||
![]() |
abe750cf7c | ||
![]() |
2a8969b437 | ||
![]() |
bf85deedb8 | ||
![]() |
6c3b02872d | ||
![]() |
4d2d8740dc | ||
![]() |
bbdaad0cba | ||
![]() |
daeaf6b1da | ||
![]() |
67faffafff | ||
![]() |
f75447afaa | ||
![]() |
121b478312 | ||
![]() |
088d5f3638 | ||
![]() |
ac1bfc0d60 | ||
![]() |
287104aafb | ||
![]() |
2d65d1d553 | ||
![]() |
3f060660c2 | ||
![]() |
01b62399af | ||
![]() |
dd01ee00cb | ||
![]() |
a5645e1d6c | ||
![]() |
09800741f0 | ||
![]() |
31a7e2616b | ||
![]() |
42d504a69a | ||
![]() |
fb72ea449a | ||
![]() |
f9a3e54364 | ||
![]() |
d3e75de23d | ||
![]() |
12274a1543 | ||
![]() |
0138b69356 | ||
![]() |
821f260ba9 | ||
![]() |
09095ced4f | ||
![]() |
d7f5736d67 | ||
![]() |
693adb417e | ||
![]() |
013dffce70 | ||
![]() |
59c809c943 | ||
![]() |
4ddadd4f53 | ||
![]() |
ae5698c621 | ||
![]() |
4b017f6c67 | ||
![]() |
e924a50c31 | ||
![]() |
88f20974dd | ||
![]() |
05fbc63732 | ||
![]() |
3cdaab7894 | ||
![]() |
e58c02d5ee | ||
![]() |
a57bffc84a | ||
![]() |
5ee854140a | ||
![]() |
ada794cab6 | ||
![]() |
e80d71bdfc | ||
![]() |
e454faab0c | ||
![]() |
6ac17dc71c | ||
![]() |
148fff91e8 | ||
![]() |
ccb040ae96 | ||
![]() |
2b9a07e840 | ||
![]() |
0255fcba86 | ||
![]() |
f2818429db | ||
![]() |
8d8033383b | ||
![]() |
a3839f6db5 | ||
![]() |
1bcce67c68 | ||
![]() |
e7b7f6c6b1 | ||
![]() |
ab8445116c | ||
![]() |
f36be640cc | ||
![]() |
2f185481a7 | ||
![]() |
5fd7ef370f | ||
![]() |
79014f00f0 | ||
![]() |
5c583341d7 | ||
![]() |
db82968b48 | ||
![]() |
7698790d1c | ||
![]() |
bcaaa7e2d2 | ||
![]() |
fca699373a | ||
![]() |
efb0324330 | ||
![]() |
c0b35306cb | ||
![]() |
35a1e1f23b | ||
![]() |
b9c5c8df59 | ||
![]() |
857b794e13 | ||
![]() |
00e147f5c1 | ||
![]() |
42938c871a | ||
![]() |
40b6427658 | ||
![]() |
f729d2bfa7 | ||
![]() |
5268c484e9 | ||
![]() |
9efdaf14b1 | ||
![]() |
8d11c5fd0f | ||
![]() |
7af16be62b | ||
![]() |
4026e24585 | ||
![]() |
a0337780b7 | ||
![]() |
3eba29dba8 | ||
![]() |
12fb916360 | ||
![]() |
cf94380e26 | ||
![]() |
52611e7f26 | ||
![]() |
f8d0e6052f | ||
![]() |
08b71487c5 | ||
![]() |
75f10955e6 | ||
![]() |
1ce2df1119 | ||
![]() |
6ace4a00f5 | ||
![]() |
9f5ff66c3d | ||
![]() |
b1e27a1430 | ||
![]() |
a315c46583 | ||
![]() |
d138b5290b | ||
![]() |
1d732c34ff | ||
![]() |
6a306a1797 | ||
![]() |
676c31b748 | ||
![]() |
727c7cad37 | ||
![]() |
ad7165dfd0 | ||
![]() |
cf0285add5 | ||
![]() |
90495522f7 | ||
![]() |
2985b0f470 | ||
![]() |
5bfff907b4 | ||
![]() |
ec52bdea83 | ||
![]() |
d1a24d1758 | ||
![]() |
7e2ea3f871 | ||
![]() |
f3f1ab931b | ||
![]() |
2bf7c92469 | ||
![]() |
5464caa6f7 | ||
![]() |
231fbbe8ca | ||
![]() |
9a53ac15df | ||
![]() |
a05c23b507 | ||
![]() |
90c8fbbf00 | ||
![]() |
e9e843280b | ||
![]() |
c68bd960ce | ||
![]() |
aa222fecb2 | ||
![]() |
6ebd179ed5 | ||
![]() |
2574795d37 | ||
![]() |
b41298a3f6 | ||
![]() |
cb97c8fcb9 | ||
![]() |
aba61efa70 | ||
![]() |
147d043a32 | ||
![]() |
df59dec319 | ||
![]() |
f5cebfe6fd | ||
![]() |
15adf84a7d | ||
![]() |
d4fd9c8d43 | ||
![]() |
151f15e282 | ||
![]() |
a6283e64cc | ||
![]() |
9c75845944 | ||
![]() |
db15f6d6a1 | ||
![]() |
026b348cf8 | ||
![]() |
711c41826a | ||
![]() |
a4e2c56c49 | ||
![]() |
7a6b41fbd4 | ||
![]() |
17bbab44c9 | ||
![]() |
b413a113f9 | ||
![]() |
280828dae6 | ||
![]() |
3320eaccb2 | ||
![]() |
22c2682574 | ||
![]() |
f64dc3f35f | ||
![]() |
6370e0b2d3 | ||
![]() |
6bfb557ca6 | ||
![]() |
959956cfc9 | ||
![]() |
99899d1d5c | ||
![]() |
591b9399a8 | ||
![]() |
f77da9cdb0 | ||
![]() |
19cb6ee521 | ||
![]() |
e92b44bc84 | ||
![]() |
c754fac10f | ||
![]() |
90a2af9fe2 | ||
![]() |
ff4181ad5a | ||
![]() |
e93702bb8d | ||
![]() |
54fc2c8fbd | ||
![]() |
7881b850ec | ||
![]() |
0da131cd9a | ||
![]() |
30635c72e8 | ||
![]() |
917faa56f5 | ||
![]() |
690346a854 | ||
![]() |
9a547b4553 | ||
![]() |
86f5a8b71b | ||
![]() |
4ee9deae62 | ||
![]() |
9e1962f006 | ||
![]() |
5456211266 | ||
![]() |
a56a4a16e8 | ||
![]() |
7295a2e7b3 | ||
![]() |
909d44f436 | ||
![]() |
a9fae5ff12 | ||
![]() |
01df8ca889 | ||
![]() |
d6d8576700 | ||
![]() |
c7efef60ac | ||
![]() |
7c2248151d | ||
![]() |
360a44f57b | ||
![]() |
0b7a5f69fa | ||
![]() |
24c644207d | ||
![]() |
1509364a49 | ||
![]() |
2afa19db01 | ||
![]() |
d291ce6d0f | ||
![]() |
089a14f9e0 | ||
![]() |
56cd448a32 | ||
![]() |
1ebf7034f5 | ||
![]() |
105b3cdde4 | ||
![]() |
97ebd14829 | ||
![]() |
53e1ec023f | ||
![]() |
8fe04c99c6 | ||
![]() |
278a61adab | ||
![]() |
1423bdd564 | ||
![]() |
79b3687424 | ||
![]() |
1ddf4e151c | ||
![]() |
af96628855 | ||
![]() |
0b8501427b | ||
![]() |
95fd04db8e | ||
![]() |
21343f2bb8 | ||
![]() |
33af3debc4 | ||
![]() |
0e08abb3e2 | ||
![]() |
7e382e6e43 | ||
![]() |
f77ed0c0ed | ||
![]() |
e5fe84dc2e | ||
![]() |
6ae87b9208 | ||
![]() |
9d85938ed7 | ||
![]() |
939622e827 | ||
![]() |
6f1eb06119 | ||
![]() |
5391bcc1bc | ||
![]() |
f21e327e69 | ||
![]() |
2419e6b4c5 | ||
![]() |
762775bc03 | ||
![]() |
b077504b3c | ||
![]() |
5008f07808 | ||
![]() |
b6dc112eb3 | ||
![]() |
5078b8a66d | ||
![]() |
bafdab20cf | ||
![]() |
3ea21f6c6a | ||
![]() |
091be036f4 | ||
![]() |
71ac6aff2f | ||
![]() |
a5f1ab8a1c | ||
![]() |
8816bd7541 | ||
![]() |
31c2a2575d | ||
![]() |
4521de2bea | ||
![]() |
538b5b6304 | ||
![]() |
97b73489d1 | ||
![]() |
6ef4392fb1 | ||
![]() |
e07a0c432a | ||
![]() |
7c9549ce88 | ||
![]() |
b3ef95e60e | ||
![]() |
b3574d6b3e | ||
![]() |
6d477ea509 | ||
![]() |
2377b2958d | ||
![]() |
21a6d83ec8 | ||
![]() |
0b2767fe4c | ||
![]() |
1aefed9602 | ||
![]() |
b094274d98 | ||
![]() |
ae4ed1fbf3 | ||
![]() |
d49d92e5cb | ||
![]() |
3520a357f5 | ||
![]() |
ebf22f2ee7 | ||
![]() |
204f32791d | ||
![]() |
e1ba0b2373 | ||
![]() |
95c73738fa | ||
![]() |
de5549ff69 | ||
![]() |
cec4e029f0 | ||
![]() |
7003d19c71 | ||
![]() |
111132238d | ||
![]() |
fe420d0bf9 | ||
![]() |
410dbcf1d5 | ||
![]() |
96d6e76c05 | ||
![]() |
ed482a17c5 | ||
![]() |
99ba76c695 | ||
![]() |
a12ca976a0 | ||
![]() |
c0f57dffb2 | ||
![]() |
b6fbab0443 | ||
![]() |
1fd9d2f0c5 | ||
![]() |
01b02d6092 | ||
![]() |
5b283550b7 | ||
![]() |
d6145ac73e | ||
![]() |
f90c53ae65 | ||
![]() |
2ba8229d23 | ||
![]() |
5d02e3a03e | ||
![]() |
6b43e02a25 | ||
![]() |
11b59994cf | ||
![]() |
4df86e53a7 | ||
![]() |
8d4dd349ae | ||
![]() |
5ae2846d97 | ||
![]() |
b164190f6a | ||
![]() |
ef953ce81e | ||
![]() |
ee4ad89451 | ||
![]() |
1c07d268b8 | ||
![]() |
3f44082457 | ||
![]() |
b6170aa40d | ||
![]() |
32caf41929 | ||
![]() |
f5b5b73f07 | ||
![]() |
9ed1135d74 | ||
![]() |
de2ffaf8e5 | ||
![]() |
d72cece54a | ||
![]() |
400b163f84 | ||
![]() |
33c19542af | ||
![]() |
1eb0b42387 | ||
![]() |
29d2b701c9 | ||
![]() |
785d24d0d2 | ||
![]() |
726ee55de4 | ||
![]() |
ac223bb8a6 | ||
![]() |
e63ab3db4f | ||
![]() |
0d025d8c3d | ||
![]() |
f72e34fefa | ||
![]() |
c60f2e3490 | ||
![]() |
bb0c1f8a08 | ||
![]() |
8ffd7aa1d4 | ||
![]() |
94868e606a | ||
![]() |
705f238e1e | ||
![]() |
1b17132631 | ||
![]() |
080b49a4ce | ||
![]() |
0ffcc4970f | ||
![]() |
66844826c6 | ||
![]() |
dcd28fadc6 | ||
![]() |
18333999a2 | ||
![]() |
b083e1d067 | ||
![]() |
5b92b80f79 | ||
![]() |
3e6e8d03a4 | ||
![]() |
71fef439ed | ||
![]() |
0307111993 | ||
![]() |
64ca5af879 | ||
![]() |
70778bc4c4 | ||
![]() |
911e0f5330 | ||
![]() |
fbd71f8dfe | ||
![]() |
809deee3a6 | ||
![]() |
375b03dcd4 | ||
![]() |
3a6e2d1661 | ||
![]() |
2e4e05369c | ||
![]() |
126ab53840 | ||
![]() |
9175b76887 | ||
![]() |
50ea1ac889 | ||
![]() |
4dbfcc5043 | ||
![]() |
7a1a67c718 | ||
![]() |
2bc07996fa | ||
![]() |
4379bfb7ec | ||
![]() |
2f8a8c1c9a | ||
![]() |
04488af790 | ||
![]() |
9a935ed559 | ||
![]() |
5957bab2e2 | ||
![]() |
d0be98feb9 | ||
![]() |
9f3985d398 | ||
![]() |
000e1335a2 | ||
![]() |
5e6dd8b1ed | ||
![]() |
4d2cf85a51 | ||
![]() |
93644b7c58 | ||
![]() |
ca60884c05 | ||
![]() |
50fa974dcc | ||
![]() |
08eef424a0 | ||
![]() |
dc85a5088f | ||
![]() |
e862d5f20b | ||
![]() |
bd1a7db46f | ||
![]() |
dd2aa7c5ec | ||
![]() |
5c02953b1c | ||
![]() |
04e806e0b4 | ||
![]() |
e69d8b24fc | ||
![]() |
449ec3a367 | ||
![]() |
b677ab5949 | ||
![]() |
6c32b62ef3 | ||
![]() |
ef066183dd | ||
![]() |
a822dd817b | ||
![]() |
775dade80f | ||
![]() |
cb8901c16d | ||
![]() |
4713282bb1 | ||
![]() |
d677c30359 | ||
![]() |
36985c92dc | ||
![]() |
2e867956eb | ||
![]() |
d89cc48bf3 | ||
![]() |
a1ef5f509f | ||
![]() |
7aaa34ddfc | ||
![]() |
e5c7c77362 | ||
![]() |
f93f59e2e5 | ||
![]() |
f54b133085 | ||
![]() |
255926ab19 | ||
![]() |
717f6bffe4 | ||
![]() |
917b5e51c2 | ||
![]() |
d5d8de36f5 | ||
![]() |
bd13edfc88 | ||
![]() |
22a68878e4 | ||
![]() |
a6c849166d | ||
![]() |
ce5174dd21 | ||
![]() |
d6139daa79 | ||
![]() |
6fc005f19c | ||
![]() |
2894b35d66 | ||
![]() |
9e547bf6e4 | ||
![]() |
6da1c53de7 | ||
![]() |
03fa68dbb6 | ||
![]() |
05e435aae7 | ||
![]() |
1d2093ab0a | ||
![]() |
a17a7200b8 | ||
![]() |
cfeef41d61 | ||
![]() |
88b1380a54 | ||
![]() |
b7527f7966 | ||
![]() |
421733e21b | ||
![]() |
df7e690469 | ||
![]() |
fc42c38706 | ||
![]() |
acafb28661 | ||
![]() |
4f1c474433 | ||
![]() |
a599638ce2 | ||
![]() |
3fa778abe2 | ||
![]() |
f57d3527d3 | ||
![]() |
f59b0dec60 | ||
![]() |
da60fa0047 | ||
![]() |
d9829fce06 | ||
![]() |
4b6189b91b | ||
![]() |
3cd61ff1b4 | ||
![]() |
7ebdd6a2a6 | ||
![]() |
1837077012 | ||
![]() |
5e997605b3 | ||
![]() |
85d129af77 | ||
![]() |
1ac71a94a5 | ||
![]() |
b604458ba8 | ||
![]() |
ce70484738 | ||
![]() |
53f54e1e19 | ||
![]() |
e450582888 | ||
![]() |
3886358592 | ||
![]() |
ed8db3d31e | ||
![]() |
ab22fe86da | ||
![]() |
d238a023c1 | ||
![]() |
f50abd81a1 | ||
![]() |
40542fd08a | ||
![]() |
b862e139fc | ||
![]() |
b76236755a | ||
![]() |
a9252c6649 | ||
![]() |
619d02d78c | ||
![]() |
bccdabbc45 | ||
![]() |
1166de205c | ||
![]() |
e785df4c8f | ||
![]() |
b4e53b3ff7 | ||
![]() |
df2240ba08 | ||
![]() |
1484df9b8f | ||
![]() |
ead266507e | ||
![]() |
0e088aec28 | ||
![]() |
ab7dedf0a5 | ||
![]() |
12e5c96607 | ||
![]() |
1bff8aad50 | ||
![]() |
1836c40468 | ||
![]() |
0ca83cf121 | ||
![]() |
5ae7fc4444 | ||
![]() |
f028026217 | ||
![]() |
3349fab89e | ||
![]() |
6299c6dd77 | ||
![]() |
93b77669bc | ||
![]() |
31fe960261 | ||
![]() |
02a1ed2d78 | ||
![]() |
247ad58344 | ||
![]() |
aeddac438e | ||
![]() |
2d07c43030 | ||
![]() |
28c5902419 | ||
![]() |
0654bbe505 | ||
![]() |
39aa742c7a | ||
![]() |
2e19f1401c | ||
![]() |
5016cd5677 | ||
![]() |
5299561aa3 | ||
![]() |
e3cfa4f9dd | ||
![]() |
b8c07d6343 | ||
![]() |
eb496d2018 | ||
![]() |
e1fc91958c | ||
![]() |
e7594f7d6a | ||
![]() |
e599cee6c8 | ||
![]() |
91bd9e2c15 | ||
![]() |
18ec54bf4b | ||
![]() |
940ebba54f | ||
![]() |
97e9cdefe9 | ||
![]() |
06aef92752 | ||
![]() |
ff8d274b4d | ||
![]() |
6cff19c44a | ||
![]() |
8a57246ec4 | ||
![]() |
3e808c1578 | ||
![]() |
eba791e11e | ||
![]() |
43fb58404d | ||
![]() |
4379d1856e | ||
![]() |
b9134ed161 | ||
![]() |
6e2a787ff8 | ||
![]() |
f41412a5a2 | ||
![]() |
30ddc3b90a | ||
![]() |
3f494ca797 | ||
![]() |
4a8fffdfdf | ||
![]() |
8e5fe1da4f | ||
![]() |
7203e6afb6 | ||
![]() |
43f0724aeb | ||
![]() |
fa3c36fc87 | ||
![]() |
e959602a94 | ||
![]() |
9bb65bd1c3 | ||
![]() |
9e85f75519 | ||
![]() |
2ba04d9f0a | ||
![]() |
174086a011 | ||
![]() |
21e3ba4653 | ||
![]() |
e2eadd09e4 | ||
![]() |
a50cb9c6b7 |
@ -1,4 +1,4 @@
|
||||
dist
|
||||
test/lib/
|
||||
test/typescript/definitions.js
|
||||
test/typescript/
|
||||
docs
|
||||
|
142
.eslintrc.cjs
Normal file
142
.eslintrc.cjs
Normal file
@ -0,0 +1,142 @@
|
||||
module.exports = {
|
||||
'extends': [
|
||||
'airbnb-base',
|
||||
'airbnb-typescript/base'
|
||||
],
|
||||
|
||||
'parser': '@typescript-eslint/parser',
|
||||
|
||||
'parserOptions': {
|
||||
'ecmaVersion': 11,
|
||||
'sourceType': 'module',
|
||||
'project': 'tsconfig.json'
|
||||
},
|
||||
|
||||
'env': {
|
||||
'browser': true,
|
||||
'es6': true,
|
||||
'node': true
|
||||
},
|
||||
|
||||
'plugins': [
|
||||
'@typescript-eslint',
|
||||
'chai-friendly',
|
||||
'import',
|
||||
'unicorn'
|
||||
],
|
||||
|
||||
'settings': {
|
||||
'import/resolver': {
|
||||
'typescript': {}
|
||||
}
|
||||
},
|
||||
|
||||
'globals': { // TODO are all these necessary?
|
||||
'globalThis': true,
|
||||
'console': true,
|
||||
'Promise': true,
|
||||
'importScripts': true,
|
||||
'process': true,
|
||||
'Event': true,
|
||||
'describe': true,
|
||||
'it': true,
|
||||
'mocha': true,
|
||||
'before': true,
|
||||
'beforeEach': true,
|
||||
'after': true,
|
||||
'afterEach': true,
|
||||
'escape': true,
|
||||
'unescape': true,
|
||||
'resolves': true,
|
||||
'rejects': true,
|
||||
'TransformStream': true,
|
||||
'BigInt': true
|
||||
},
|
||||
|
||||
'rules': {
|
||||
'arrow-body-style': 'off',
|
||||
'arrow-parens': ['error','as-needed'],
|
||||
'class-methods-use-this': 'off',
|
||||
'@typescript-eslint/comma-dangle': ['error', 'never'],
|
||||
'@typescript-eslint/comma-spacing': 'off',
|
||||
'consistent-return': 'off',
|
||||
'default-case': 'off',
|
||||
'@typescript-eslint/default-param-last': 'off',
|
||||
'eol-last': ['error', 'always'],
|
||||
'function-call-argument-newline': 'off',
|
||||
'func-names': ['error', 'never'],
|
||||
'function-paren-newline': 'off',
|
||||
'global-require': 'off',
|
||||
'key-spacing': 'off',
|
||||
'keyword-spacing': 'error',
|
||||
'max-classes-per-file': 'off',
|
||||
'max-len': 'off',
|
||||
'newline-per-chained-call': 'off',
|
||||
'no-bitwise': 'off',
|
||||
'no-continue': 'off',
|
||||
'no-else-return': 'off',
|
||||
'no-empty': ['error', { 'allowEmptyCatch': true }],
|
||||
'no-multiple-empty-lines': ['error', { 'max': 2, 'maxEOF': 1, 'maxBOF':0 }],
|
||||
'no-nested-ternary': 'off',
|
||||
'no-param-reassign': 'off', // TODO get rid of this
|
||||
'no-plusplus': 'off',
|
||||
'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'],
|
||||
'object-curly-newline': 'off',
|
||||
'@typescript-eslint/no-shadow': 'off', // TODO get rid of this
|
||||
'object-property-newline': [
|
||||
'error',
|
||||
{
|
||||
'allowMultiplePropertiesPerLine': true
|
||||
}
|
||||
],
|
||||
'object-shorthand': 'off',
|
||||
'operator-assignment': 'off',
|
||||
'operator-linebreak': [
|
||||
'error',
|
||||
'after'
|
||||
],
|
||||
'padded-blocks': 'off',
|
||||
'prefer-arrow-callback': 'off',
|
||||
'prefer-destructuring': 'off',
|
||||
'prefer-rest-params': 'off', // TODO get rid of this
|
||||
'prefer-spread': 'off', // TODO get rid of this
|
||||
'prefer-template': 'off',
|
||||
'quote-props': 'off',
|
||||
'quotes': ['error', 'single', { 'avoidEscape': true }],
|
||||
'@typescript-eslint/space-before-function-paren': ['error', { 'anonymous': 'ignore', 'named': 'never', 'asyncArrow': 'always' }],
|
||||
'spaced-comment': 'off',
|
||||
'indent': 'off',
|
||||
'@typescript-eslint/indent': ['error', 2, { 'SwitchCase': 1 }],
|
||||
'no-unused-vars': 'off',
|
||||
'@typescript-eslint/no-unused-vars': 'error',
|
||||
|
||||
// eslint-plugin-import rules:
|
||||
'import/named': 'error',
|
||||
'import/extensions': 'off', // temporary: we use them in tests (ESM compliant), but not in the lib (to limit diff)
|
||||
'import/first': 'off',
|
||||
'import/no-extraneous-dependencies': ['error', { 'devDependencies': true, 'optionalDependencies': false, 'peerDependencies': false }],
|
||||
'import/no-unassigned-import': 'error',
|
||||
'import/no-unresolved': 'error',
|
||||
'import/prefer-default-export': 'off',
|
||||
|
||||
// Custom silencers:
|
||||
'no-multi-assign': 'off',
|
||||
'no-underscore-dangle': 'off',
|
||||
'no-await-in-loop': 'off',
|
||||
'camelcase': 'off', // snake_case used in tests, need to fix separately
|
||||
'@typescript-eslint/naming-convention': 'off', // supersedes 'camelcase' rule
|
||||
'@typescript-eslint/lines-between-class-members': 'off',
|
||||
|
||||
// Custom errors:
|
||||
'@typescript-eslint/no-use-before-define': ['error', { 'functions': false, 'classes': true, 'variables': false, 'allowNamedExports': true }],
|
||||
'no-constant-condition': [2, { 'checkLoops': false }],
|
||||
'new-cap': [2, { 'properties': false, 'capIsNewExceptionPattern': 'EAX|OCB|GCM|CMAC|CBC|OMAC|CTR', 'newIsCapExceptionPattern': 'type|hash*' }],
|
||||
'max-lines': [2, { 'max': 620, 'skipBlankLines': true, 'skipComments': true }],
|
||||
'@typescript-eslint/no-unused-expressions': 0,
|
||||
'chai-friendly/no-unused-expressions': [2, { 'allowShortCircuit': true }],
|
||||
'unicorn/switch-case-braces': ['error', 'avoid'],
|
||||
|
||||
// Custom warnings:
|
||||
'no-console': 1
|
||||
}
|
||||
};
|
354
.eslintrc.js
354
.eslintrc.js
@ -1,354 +0,0 @@
|
||||
module.exports = {
|
||||
"extends": "airbnb-base",
|
||||
"parser": "babel-eslint",
|
||||
"parserOptions": { "sourceType": "module" },
|
||||
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true,
|
||||
"node": true
|
||||
},
|
||||
|
||||
"plugins": [
|
||||
"chai-friendly"
|
||||
],
|
||||
|
||||
"globals": { // TODO are all these necessary?
|
||||
"globalThis": true,
|
||||
"console": true,
|
||||
"Promise": true,
|
||||
"importScripts": true,
|
||||
"process": true,
|
||||
"Event": true,
|
||||
"describe": true,
|
||||
"it": true,
|
||||
"sinon": true,
|
||||
"mocha": true,
|
||||
"before": true,
|
||||
"beforeEach": true,
|
||||
"after": true,
|
||||
"afterEach": true,
|
||||
"escape": true,
|
||||
"unescape": true,
|
||||
"postMessage": true,
|
||||
"resolves": true,
|
||||
"rejects": true,
|
||||
"TransformStream": true,
|
||||
"BigInt": true
|
||||
},
|
||||
|
||||
"rules": {
|
||||
// Auto generated rules:
|
||||
"accessor-pairs": "error",
|
||||
"array-bracket-newline": "error",
|
||||
"array-bracket-spacing": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"array-callback-return": "error",
|
||||
"array-element-newline": "off",
|
||||
"arrow-body-style": "off",
|
||||
"arrow-parens": [
|
||||
"error",
|
||||
"as-needed"
|
||||
],
|
||||
"arrow-spacing": [
|
||||
"error",
|
||||
{
|
||||
"after": true,
|
||||
"before": true
|
||||
}
|
||||
],
|
||||
"block-spacing": [
|
||||
"error",
|
||||
"always"
|
||||
],
|
||||
"brace-style": "off",
|
||||
"callback-return": "error",
|
||||
"camelcase": [
|
||||
"error",
|
||||
{
|
||||
"properties": "never"
|
||||
}
|
||||
],
|
||||
"capitalized-comments": "off",
|
||||
"class-methods-use-this": "error",
|
||||
"comma-dangle": [ "error", "never" ],
|
||||
"comma-spacing": "off",
|
||||
"comma-style": [
|
||||
"error",
|
||||
"last"
|
||||
],
|
||||
"complexity": "off",
|
||||
"computed-property-spacing": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"consistent-return": "off",
|
||||
"consistent-this": "error",
|
||||
"curly": "error",
|
||||
"default-case": "off",
|
||||
"dot-location": "error",
|
||||
"dot-notation": [
|
||||
"error",
|
||||
{
|
||||
"allowKeywords": true
|
||||
}
|
||||
],
|
||||
"eol-last": ["error", "always"],
|
||||
"eqeqeq": "error",
|
||||
"for-direction": "error",
|
||||
"func-call-spacing": "error",
|
||||
"func-name-matching": "error",
|
||||
"func-names": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"func-style": "off",
|
||||
"function-paren-newline": "off",
|
||||
"generator-star-spacing": "error",
|
||||
"getter-return": "error",
|
||||
"global-require": "off",
|
||||
"guard-for-in": "off",
|
||||
"handle-callback-err": "error",
|
||||
"id-blacklist": "error",
|
||||
"id-length": "off",
|
||||
"id-match": "error",
|
||||
"implicit-arrow-linebreak": [
|
||||
"error",
|
||||
"beside"
|
||||
],
|
||||
"init-declarations": "off",
|
||||
"jsx-quotes": "error",
|
||||
"key-spacing": "off",
|
||||
"keyword-spacing": "error",
|
||||
"line-comment-position": "off",
|
||||
"linebreak-style": [
|
||||
"error",
|
||||
"unix"
|
||||
],
|
||||
"lines-around-comment": "off",
|
||||
"lines-around-directive": "error",
|
||||
"lines-between-class-members": "error",
|
||||
"max-depth": "off",
|
||||
"max-len": "off",
|
||||
"max-lines": "off",
|
||||
"max-nested-callbacks": "error",
|
||||
"max-params": "off",
|
||||
"max-statements": "off",
|
||||
"max-statements-per-line": "off",
|
||||
"multiline-comment-style": "off",
|
||||
"multiline-ternary": "off",
|
||||
"new-parens": "error",
|
||||
"newline-after-var": "off",
|
||||
"newline-before-return": "off",
|
||||
"newline-per-chained-call": "off",
|
||||
"no-alert": "error",
|
||||
"no-array-constructor": "error",
|
||||
"no-bitwise": "off",
|
||||
"no-buffer-constructor": "error",
|
||||
"no-caller": "error",
|
||||
"no-catch-shadow": "error",
|
||||
"no-confusing-arrow": "error",
|
||||
"no-continue": "off",
|
||||
"no-div-regex": "error",
|
||||
"no-duplicate-imports": "error",
|
||||
"no-else-return": "off",
|
||||
"no-empty": [
|
||||
"error",
|
||||
{
|
||||
"allowEmptyCatch": true
|
||||
}
|
||||
],
|
||||
"no-empty-function": "off",
|
||||
"no-eq-null": "error",
|
||||
"no-eval": "error",
|
||||
"no-extend-native": "error",
|
||||
"no-extra-bind": "error",
|
||||
"no-extra-label": "error",
|
||||
"no-extra-parens": "off",
|
||||
"no-floating-decimal": "error",
|
||||
"no-implicit-globals": "error",
|
||||
"no-implied-eval": "error",
|
||||
"no-inline-comments": "off",
|
||||
"no-inner-declarations": [
|
||||
"error",
|
||||
"functions"
|
||||
],
|
||||
"no-invalid-this": "error",
|
||||
"no-iterator": "error",
|
||||
"no-label-var": "error",
|
||||
"no-labels": "error",
|
||||
"no-lone-blocks": "error",
|
||||
"no-lonely-if": "error",
|
||||
"no-loop-func": "error",
|
||||
"no-magic-numbers": "off",
|
||||
"no-mixed-operators": "off",
|
||||
"no-mixed-requires": "error",
|
||||
"no-multi-assign": "error",
|
||||
"no-multi-spaces": [
|
||||
"error",
|
||||
{
|
||||
"ignoreEOLComments": true
|
||||
}
|
||||
],
|
||||
"no-multi-str": "error",
|
||||
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF":0 }],
|
||||
"no-native-reassign": "error",
|
||||
"no-negated-condition": "off",
|
||||
"no-negated-in-lhs": "error",
|
||||
"no-nested-ternary": "off",
|
||||
"no-new": "error",
|
||||
"no-new-func": "error",
|
||||
"no-new-object": "error",
|
||||
"no-new-require": "error",
|
||||
"no-new-wrappers": "error",
|
||||
"no-octal-escape": "error",
|
||||
"no-param-reassign": "off",
|
||||
"no-path-concat": "error",
|
||||
"no-plusplus": "off",
|
||||
"no-process-env": "error",
|
||||
"no-process-exit": "error",
|
||||
"no-proto": "error",
|
||||
"no-prototype-builtins": "off",
|
||||
"no-restricted-globals": "error",
|
||||
"no-restricted-imports": "error",
|
||||
"no-restricted-modules": "error",
|
||||
"no-restricted-properties": "error",
|
||||
"no-restricted-syntax": "error",
|
||||
"no-return-assign": "error",
|
||||
"no-return-await": "error",
|
||||
"no-script-url": "error",
|
||||
"no-self-compare": "error",
|
||||
"no-shadow": "off",
|
||||
"no-shadow-restricted-names": "error",
|
||||
"no-spaced-func": "error",
|
||||
"no-sync": "error",
|
||||
"no-tabs": "error",
|
||||
"no-template-curly-in-string": "error",
|
||||
"no-ternary": "off",
|
||||
"no-throw-literal": "error",
|
||||
"no-undef-init": "error",
|
||||
"no-undefined": "off",
|
||||
"no-unmodified-loop-condition": "error",
|
||||
"no-unneeded-ternary": [
|
||||
"error",
|
||||
{
|
||||
"defaultAssignment": true
|
||||
}
|
||||
],
|
||||
"no-use-before-define": "off",
|
||||
"no-useless-call": "error",
|
||||
"no-useless-computed-key": "error",
|
||||
"no-useless-concat": "error",
|
||||
"no-useless-constructor": "error",
|
||||
"no-useless-rename": "error",
|
||||
"no-useless-return": "error",
|
||||
"no-void": "error",
|
||||
"no-warning-comments": "off",
|
||||
"no-whitespace-before-property": "error",
|
||||
"no-with": "error",
|
||||
"nonblock-statement-body-position": "error",
|
||||
"object-curly-newline": "off",
|
||||
"object-curly-spacing": "error",
|
||||
"object-property-newline": [
|
||||
"error",
|
||||
{
|
||||
"allowMultiplePropertiesPerLine": true
|
||||
}
|
||||
],
|
||||
"object-shorthand": "off",
|
||||
"one-var-declaration-per-line": [
|
||||
"error",
|
||||
"initializations"
|
||||
],
|
||||
"operator-assignment": "off",
|
||||
"operator-linebreak": [
|
||||
"error",
|
||||
"after"
|
||||
],
|
||||
"padded-blocks": "off",
|
||||
"padding-line-between-statements": "error",
|
||||
"prefer-arrow-callback": "off",
|
||||
"prefer-destructuring": "off",
|
||||
"prefer-numeric-literals": "error",
|
||||
"prefer-promise-reject-errors": "error",
|
||||
"prefer-reflect": "off",
|
||||
"prefer-rest-params": "off",
|
||||
"prefer-spread": "off",
|
||||
"prefer-template": "off",
|
||||
"quote-props": "off",
|
||||
"quotes": "off",
|
||||
"require-await": "error",
|
||||
"require-jsdoc": "off",
|
||||
"semi-spacing": [
|
||||
"error",
|
||||
{
|
||||
"after": true,
|
||||
"before": false
|
||||
}
|
||||
],
|
||||
"semi-style": [
|
||||
"error",
|
||||
"last"
|
||||
],
|
||||
"sort-imports": "off",
|
||||
"sort-keys": "off",
|
||||
"sort-vars": "off",
|
||||
"space-before-blocks": "off",
|
||||
"space-before-function-paren": "off",
|
||||
"space-in-parens": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"space-infix-ops": "error",
|
||||
"space-unary-ops": "error",
|
||||
"spaced-comment": "off",
|
||||
"strict": "off",
|
||||
"switch-colon-spacing": "error",
|
||||
"symbol-description": "error",
|
||||
"template-curly-spacing": "error",
|
||||
"template-tag-spacing": "error",
|
||||
"unicode-bom": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"wrap-iife": "error",
|
||||
"wrap-regex": "off",
|
||||
"yield-star-spacing": "error",
|
||||
"yoda": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"indent": [ "error", 2, { "SwitchCase": 1 } ],
|
||||
"no-buffer-constructor": "error",
|
||||
"no-lonely-if": "error",
|
||||
"no-unused-vars": "error",
|
||||
|
||||
// eslint-plugin-import rules:
|
||||
"import/extensions": "never",
|
||||
"import/no-extraneous-dependencies": ["error", {"devDependencies": true, "optionalDependencies": false, "peerDependencies": false}],
|
||||
"import/no-unassigned-import": "error",
|
||||
|
||||
// Custom silencers:
|
||||
"camelcase": 0,
|
||||
"require-await": 0,
|
||||
"no-multi-assign": 0,
|
||||
"no-underscore-dangle": 0,
|
||||
"no-await-in-loop": 0,
|
||||
|
||||
// Custom errors:
|
||||
"no-undef": 2,
|
||||
"no-trailing-spaces": 2,
|
||||
"no-mixed-operators": [ 2, {"groups": [["&", "|", "^", "~", "<<", ">>", ">>>"], ["&&", "||"]]}],
|
||||
"no-use-before-define": [ 2, { "functions": false, "classes": true, "variables": false }],
|
||||
"no-constant-condition": [ 2, { "checkLoops": false } ],
|
||||
"new-cap": [ 2, { "properties": false, "capIsNewExceptionPattern": "EAX|OCB|GCM|CMAC|CBC|OMAC|CTR", "newIsCapExceptionPattern": "type|hash*"}],
|
||||
"max-lines": [ 2, { "max": 600, "skipBlankLines": true, "skipComments": true } ],
|
||||
"no-unused-expressions": 0,
|
||||
"chai-friendly/no-unused-expressions": [ 2, { "allowShortCircuit": true } ],
|
||||
|
||||
// Custom warnings:
|
||||
"no-console": 1,
|
||||
}
|
||||
};
|
10
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
Normal file
10
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Report an issue with this library
|
||||
---
|
||||
<!-- Please search existing issues and discussions to avoid creating duplicates. -->
|
||||
|
||||
- OpenPGP.js version:
|
||||
- Affected platform (Browser or Node.js version):
|
||||
|
||||
<!-- Describe the bug you have encountered -->
|
8
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
8
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Feature request
|
||||
url: https://github.com/openpgpjs/openpgpjs/discussions/categories/ideas
|
||||
about: Suggest an idea for this project
|
||||
- name: Question
|
||||
url: https://github.com/openpgpjs/openpgpjs/discussions/categories/q-a
|
||||
about: Please ask any questions here
|
33
.github/dependabot.yml
vendored
Normal file
33
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "npm"
|
||||
# The redundant target-branch directive is needed to set two different update schedules for npm,
|
||||
# working around a dependabot limitation:
|
||||
# see https://github.com/dependabot/dependabot-core/issues/1778#issuecomment-1988140219 .
|
||||
target-branch: main
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
allow:
|
||||
- dependency-name: "playwright"
|
||||
versioning-strategy: increase
|
||||
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
allow:
|
||||
- dependency-name: "@noble*"
|
||||
- dependency-name: "fflate"
|
||||
versioning-strategy: increase
|
||||
groups:
|
||||
# Any packages matching the pattern @noble* where the highest resolvable
|
||||
# version is minor or patch will be grouped together.
|
||||
# Grouping rules apply to version updates only.
|
||||
noble:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "@noble*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
39
.github/test-suite/config.json.template
vendored
Normal file
39
.github/test-suite/config.json.template
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
{
|
||||
"drivers": [
|
||||
{
|
||||
"id": "sop-openpgpjs-branch",
|
||||
"path": "__SOP_OPENPGPJS__",
|
||||
"env": {
|
||||
"OPENPGPJS_PATH": "__OPENPGPJS_BRANCH__"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "sop-openpgpjs-main",
|
||||
"path": "__SOP_OPENPGPJS__",
|
||||
"env": {
|
||||
"OPENPGPJS_PATH": "__OPENPGPJS_MAIN__",
|
||||
"DISABLE_PROFILES": "true"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "__SQOP__"
|
||||
},
|
||||
{
|
||||
"path": "__GPGME_SOP__"
|
||||
},
|
||||
{
|
||||
"id": "gosop-v2",
|
||||
"path": "__GOSOP_V2__"
|
||||
},
|
||||
{
|
||||
"path": "__RNP_SOP__"
|
||||
},
|
||||
{
|
||||
"path": "__RSOP__"
|
||||
}
|
||||
],
|
||||
"rlimits": {
|
||||
"DATA": 1073741824
|
||||
}
|
||||
}
|
||||
|
14
.github/test-suite/prepare_config.sh
vendored
Executable file
14
.github/test-suite/prepare_config.sh
vendored
Executable file
@ -0,0 +1,14 @@
|
||||
CONFIG_TEMPLATE=$1
|
||||
CONFIG_OUTPUT=$2
|
||||
OPENPGPJS_BRANCH=$3
|
||||
OPENPGPJS_MAIN=$4
|
||||
cat $CONFIG_TEMPLATE \
|
||||
| sed "s@__OPENPGPJS_BRANCH__@${OPENPGPJS_BRANCH}@g" \
|
||||
| sed "s@__OPENPGPJS_MAIN__@${OPENPGPJS_MAIN}@g" \
|
||||
| sed "s@__SQOP__@${SQOP}@g" \
|
||||
| sed "s@__GPGME_SOP__@${GPGME_SOP}@g" \
|
||||
| sed "s@__GOSOP_V2__@${GOSOP_V2}@g" \
|
||||
| sed "s@__SOP_OPENPGPJS__@${SOP_OPENPGPJS_V2}@g" \
|
||||
| sed "s@__RNP_SOP__@${RNP_SOP}@g" \
|
||||
| sed "s@__RSOP__@${RSOP}@g" \
|
||||
> $CONFIG_OUTPUT
|
67
.github/workflows/benchmark.yml
vendored
Normal file
67
.github/workflows/benchmark.yml
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
name: Performance Regression Test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
benchmark:
|
||||
name: Time and memory usage benchmark
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# check out pull request branch
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: pr
|
||||
# check out main branch (to compare performance)
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: main
|
||||
path: main
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '>=20.6.0'
|
||||
|
||||
- name: Run pull request time benchmark
|
||||
run: cd pr && npm install && npm run --silent benchmark-time > benchmarks.txt && cat benchmarks.txt
|
||||
|
||||
- name: Run pull request memory usage benchmark
|
||||
run: cd pr && npm run --silent benchmark-memory-usage > memory_usage.txt && cat memory_usage.txt
|
||||
|
||||
- name: Run time benchmark on main (baseline)
|
||||
run: cd main && npm install && npm run --silent benchmark-time > benchmarks.txt && cat benchmarks.txt
|
||||
|
||||
- name: Run memory usage benchmark on main (baseline)
|
||||
run: cd main && npm run --silent benchmark-memory-usage > memory_usage.txt && cat memory_usage.txt
|
||||
|
||||
- name: Compare time benchmark result
|
||||
uses: openpgpjs/github-action-pull-request-benchmark@v1
|
||||
with:
|
||||
tool: 'benchmarkjs'
|
||||
name: 'Time benchmark'
|
||||
pr-benchmark-file-path: pr/benchmarks.txt
|
||||
base-benchmark-file-path: main/benchmarks.txt
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# trigger alert comment if 1.3 times slower
|
||||
alert-threshold: '130%'
|
||||
comment-on-alert: false
|
||||
# fail workdlow if 1.5 times slower
|
||||
fail-threshold: '150%'
|
||||
fail-on-alert: true
|
||||
file-to-annotate: ${{ github.workspace }}/test/benchmarks/time.js
|
||||
|
||||
- name: Compare memory usage benchmark result
|
||||
uses: openpgpjs/github-action-pull-request-benchmark@v1
|
||||
with:
|
||||
tool: 'raw'
|
||||
name: 'Memory usage benchmark'
|
||||
pr-benchmark-file-path: pr/memory_usage.txt
|
||||
base-benchmark-file-path: main/memory_usage.txt
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
alert-threshold: '102%'
|
||||
comment-on-alert: false
|
||||
fail-threshold: '110%'
|
||||
fail-on-alert: true
|
||||
file-to-annotate: ${{ github.workspace }}/test/benchmarks/memory_usage.js
|
||||
|
40
.github/workflows/browserstack.yml
vendored
40
.github/workflows/browserstack.yml
vendored
@ -1,40 +0,0 @@
|
||||
name: Test on Browserstack
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
full:
|
||||
name: Full Build
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
- run: npm ci
|
||||
- run: npm run build-test
|
||||
- run: npm run browserstack
|
||||
|
||||
lightweight:
|
||||
name: Lightweight Build
|
||||
|
||||
needs: full
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
- run: npm ci
|
||||
- run: npm run build-test --lightweight
|
||||
- run: npm run browserstack
|
||||
env:
|
||||
LIGHTWEIGHT: true
|
||||
|
||||
env:
|
||||
BROWSERSTACK_USERNAME: danielhuigens2
|
||||
BROWSERSTACK_KEY: aW2q1ms393QRorwBnfmW
|
19
.github/workflows/docs.yml
vendored
Normal file
19
.github/workflows/docs.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
name: Documentation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: JSDoc
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
- run: npm ci --ignore-scripts
|
||||
- run: npm run docs
|
19
.github/workflows/lint.yml
vendored
19
.github/workflows/lint.yml
vendored
@ -1,19 +0,0 @@
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: ESLint
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
29
.github/workflows/node.js.yml
vendored
29
.github/workflows/node.js.yml
vendored
@ -1,29 +0,0 @@
|
||||
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
||||
|
||||
name: Test on Node.js
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: ${{ matrix.node-version }}
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x, 14.x, 15.x]
|
||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: npm ci
|
||||
- run: npm test
|
87
.github/workflows/sop-test-suite.yml
vendored
Normal file
87
.github/workflows/sop-test-suite.yml
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
name: SOP interoperability test suite
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
|
||||
test-suite:
|
||||
name: Run interoperability test suite
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/protonmail/openpgp-interop-test-docker:v1.1.12
|
||||
credentials:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.github_token }}
|
||||
steps:
|
||||
# check out repo for scripts
|
||||
- uses: actions/checkout@v4
|
||||
# check out pull request branch
|
||||
- name: Checkout openpgpjs-branch
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: openpgpjs-branch
|
||||
- name: Install openpgpjs-branch
|
||||
run: cd openpgpjs-branch && npm install
|
||||
- name: Print openpgpjs-branch version
|
||||
run: $SOP_OPENPGPJS_V2 version --extended
|
||||
env:
|
||||
OPENPGPJS_PATH: ${{ github.workspace }}/openpgpjs-branch
|
||||
# check out main branch
|
||||
- name: Checkout openpgpjs-main
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: main
|
||||
path: openpgpjs-main
|
||||
- name: Install openpgpjs-main
|
||||
run: cd openpgpjs-main && npm install
|
||||
- name: Print openpgpjs-main version
|
||||
run: $SOP_OPENPGPJS_V2 version --extended
|
||||
env:
|
||||
OPENPGPJS_PATH: ${{ github.workspace }}/openpgpjs-main
|
||||
# Run test suite
|
||||
- name: Prepare test configuration
|
||||
run: ./.github/test-suite/prepare_config.sh $CONFIG_TEMPLATE $CONFIG_OUTPUT $GITHUB_WORKSPACE/openpgpjs-branch $GITHUB_WORKSPACE/openpgpjs-main
|
||||
env:
|
||||
CONFIG_TEMPLATE: .github/test-suite/config.json.template
|
||||
CONFIG_OUTPUT: .github/test-suite/config.json
|
||||
- name: Display configuration
|
||||
run: cat .github/test-suite/config.json
|
||||
- name: Run interoperability test suite
|
||||
run: cd $TEST_SUITE_DIR && $TEST_SUITE --config $GITHUB_WORKSPACE/$CONFIG --json-out $GITHUB_WORKSPACE/$RESULTS_JSON --html-out $GITHUB_WORKSPACE/$RESULTS_HTML
|
||||
env:
|
||||
CONFIG: .github/test-suite/config.json
|
||||
RESULTS_JSON: .github/test-suite/test-suite-results.json
|
||||
RESULTS_HTML: .github/test-suite/test-suite-results.html
|
||||
# Upload results
|
||||
- name: Upload test results json artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: test-suite-results.json
|
||||
path: .github/test-suite/test-suite-results.json
|
||||
- name: Upload test results html artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: test-suite-results.html
|
||||
path: .github/test-suite/test-suite-results.html
|
||||
|
||||
compare-with-main:
|
||||
name: Compare with main
|
||||
runs-on: ubuntu-latest
|
||||
needs: test-suite
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Download test results json artifact
|
||||
id: download-test-results
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: test-suite-results.json
|
||||
- name: Compare with baseline
|
||||
uses: ProtonMail/openpgp-interop-test-analyzer@v2
|
||||
with:
|
||||
results: ${{ steps.download-test-results.outputs.download-path }}/test-suite-results.json
|
||||
output: baseline-comparison.json
|
||||
baseline: sop-openpgpjs-main
|
||||
target: sop-openpgpjs-branch
|
206
.github/workflows/tests.yml
vendored
Normal file
206
.github/workflows/tests.yml
vendored
Normal file
@ -0,0 +1,206 @@
|
||||
name: Code Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
build: # cache both dist and tests (non-lightweight only), based on commit hash
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
- name: Check for cached folders
|
||||
id: cache-full
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
dist
|
||||
test/lib
|
||||
key: cache-${{ github.sha }}
|
||||
- name: Build dist and tests
|
||||
if: steps.cache-full.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm ci
|
||||
npm run build-test
|
||||
|
||||
node:
|
||||
strategy:
|
||||
fail-fast: false # if tests for one version fail, continue with the rest
|
||||
matrix:
|
||||
node-version: [18.x, 20.x, 22.x]
|
||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||
|
||||
name: Node ${{ matrix.node-version }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: npm ci --ignore-scripts # for mocha
|
||||
- name: Retrieve cached folders
|
||||
uses: actions/cache/restore@v4
|
||||
id: cache-full
|
||||
with:
|
||||
# test/lib is not needed, but the path must be specified fully for a cache-hit
|
||||
path: |
|
||||
dist
|
||||
test/lib
|
||||
key: cache-${{ github.sha }}
|
||||
# ignore cache miss, since it was taken care of the `build` step and it should never occur here
|
||||
- run: npm test
|
||||
|
||||
test-browsers-latest:
|
||||
name: Browsers (latest)
|
||||
needs: build
|
||||
strategy:
|
||||
fail-fast: false # if tests for one version fail, continue with the rest
|
||||
matrix:
|
||||
# run on all main platforms to test platform-specific code, if present
|
||||
# (e.g. webkit's WebCrypto API implementation is different in macOS vs Linux)
|
||||
# TODO: windows-latest fails to fetch resources from the wtr server; investigate if the problem is with path declaration or permissions
|
||||
runner: ['ubuntu-latest', 'macos-latest']
|
||||
runs-on: ${{ matrix.runner }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
|
||||
- name: Retrieve cached built folders
|
||||
uses: actions/cache/restore@v4
|
||||
id: cache-full
|
||||
with:
|
||||
path: |
|
||||
dist
|
||||
test/lib
|
||||
key: cache-${{ github.sha }}
|
||||
|
||||
- name: Install dependencies
|
||||
# cannot use `--ignore-scripts` since playwright seems to use it to set ENV vars
|
||||
run: |
|
||||
npm pkg delete scripts.prepare
|
||||
npm ci
|
||||
|
||||
- name: Get Playwright version and cache location
|
||||
id: playwright-version
|
||||
run: |
|
||||
PLAYWRIGHT_VERSION=$(npm ls playwright --depth=0 | grep playwright | sed 's/.*@//')
|
||||
echo "version=$PLAYWRIGHT_VERSION" >> $GITHUB_OUTPUT
|
||||
PLAYWRIGHT_CACHE=${{ fromJSON('{"ubuntu-latest": "~/.cache/ms-playwright", "macos-latest": "~/Library/Caches/ms-playwright"}')[matrix.runner] }}
|
||||
echo "playwright_cache=$PLAYWRIGHT_CACHE" >> $GITHUB_OUTPUT
|
||||
- name: Check for cached browsers
|
||||
id: cache-playwright-browsers
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ steps.playwright-version.outputs.playwright_cache }}
|
||||
key: playwright-browsers-${{ matrix.runner }}-${{ steps.playwright-version.outputs.version }}
|
||||
- name: Install browsers
|
||||
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npx playwright install --with-deps chromium
|
||||
npx playwright install --with-deps firefox
|
||||
|
||||
- name: Install WebKit # caching not possible, external shared libraries required
|
||||
if: ${{ matrix.runner == 'macos-latest' }} # do not install on ubuntu, since the X25519 WebCrypto implementation has issues
|
||||
run: npx playwright install --with-deps webkit
|
||||
|
||||
- name: Run browser tests
|
||||
run: npm run test-browser:ci -- --static-logging
|
||||
|
||||
- name: Run browser tests (lightweight) # overwrite test/lib
|
||||
run: |
|
||||
npm run build-test --lightweight
|
||||
npm run test-browser:ci -- --static-logging
|
||||
|
||||
test-browsers-compatibility:
|
||||
name: Browsers (older, on Browserstack)
|
||||
runs-on: ubuntu-latest
|
||||
needs: test-browsers-latest
|
||||
env: # credentials need hardcoding for now since Github secrets aren't accessible on pull requests from forks
|
||||
BROWSERSTACK_USERNAME: openpgpjs_PlY4Uq885CQ
|
||||
BROWSERSTACK_ACCESS_KEY: VjgBVRMxNVBj7SjJFiau
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
|
||||
- name: Generate self-signed HTTPS certificates for web-test-runner server
|
||||
uses: kofemann/action-create-certificate@v0.0.4
|
||||
with:
|
||||
hostcert: '127.0.0.1.pem'
|
||||
hostkey: '127.0.0.1-key.pem'
|
||||
cachain: 'ca-chain.pem'
|
||||
- name: Adjust HTTPS certificates permissions
|
||||
run: sudo chown runner:docker *.pem
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts
|
||||
|
||||
- name: Retrieve cached dist folder
|
||||
uses: actions/cache/restore@v4
|
||||
id: cache-full
|
||||
with:
|
||||
path: |
|
||||
dist
|
||||
test/lib
|
||||
key: cache-${{ github.sha }}
|
||||
|
||||
- name: Wait for other Browserstack tests to finish
|
||||
uses: softprops/turnstyle@v1
|
||||
with:
|
||||
poll-interval-seconds: 30
|
||||
abort-after-seconds: 900
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Run browserstack tests
|
||||
run: npm run test-browserstack -- --static-logging
|
||||
|
||||
- name: Run browserstack tests (lightweight) # overwrite test/lib
|
||||
run: |
|
||||
npm run build-test --lightweight
|
||||
npm run test-browserstack -- --static-logging
|
||||
env:
|
||||
LIGHTWEIGHT: true
|
||||
|
||||
types:
|
||||
name: Type definitions
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
- run: npm ci --ignore-scripts # TS
|
||||
- name: Retrieve cached folders
|
||||
uses: actions/cache/restore@v4
|
||||
id: cache-full
|
||||
with:
|
||||
path: |
|
||||
dist
|
||||
test/lib
|
||||
key: cache-${{ github.sha }}
|
||||
- run: npm run test-type-definitions
|
||||
|
||||
lint:
|
||||
name: ESLint
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
- run: npm ci --ignore-scripts # linter
|
||||
- name: Retrieve cached folders
|
||||
uses: actions/cache/restore@v4
|
||||
id: cache-full
|
||||
with:
|
||||
path: |
|
||||
dist
|
||||
test/lib
|
||||
key: cache-${{ github.sha }}
|
||||
- run: npm run lint
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -5,4 +5,4 @@ test/lib/
|
||||
test/typescript/definitions.js
|
||||
dist/
|
||||
openpgp.store/
|
||||
.nyc_output/
|
||||
coverage
|
||||
|
@ -7,6 +7,7 @@ module.exports = {
|
||||
},
|
||||
templates: {
|
||||
default: {
|
||||
includeDate: false,
|
||||
outputSourceFiles: false,
|
||||
externalSourceLinks: {
|
||||
urlPrefix: `${pkg.repository.url}/blob/v${pkg.version}/src/`
|
6
.mocharc.json
Normal file
6
.mocharc.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"node-option": [
|
||||
"experimental-specifier-resolution=node",
|
||||
"loader=ts-node/esm"
|
||||
]
|
||||
}
|
409
README.md
409
README.md
@ -1,7 +1,7 @@
|
||||
OpenPGP.js [](https://automate.browserstack.com/public-build/eEkxVVM1TytwOGJNWEdnTjk4Y0VNUUNyR3pXcEtJUGRXOVFBRjVNT1JpUT0tLTZYUlZaMWdtQWs4Z0ROS3grRXc2bFE9PQ==--4a9cac0d6ea009d81aff66de0dbb239edd1aef3c) [](https://gitter.im/openpgpjs/openpgpjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
OpenPGP.js [](https://gitter.im/openpgpjs/openpgpjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
==========
|
||||
|
||||
[OpenPGP.js](https://openpgpjs.org/) is a JavaScript implementation of the OpenPGP protocol. It implements [RFC4880](https://tools.ietf.org/html/rfc4880) and parts of [RFC4880bis](https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-10).
|
||||
[OpenPGP.js](https://openpgpjs.org/) is a JavaScript implementation of the OpenPGP protocol. It implements [RFC 9580](https://datatracker.ietf.org/doc/rfc9580/) (superseding [RFC 4880](https://tools.ietf.org/html/rfc4880) and [RFC 4880bis](https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-10)).
|
||||
|
||||
**Table of Contents**
|
||||
|
||||
@ -10,18 +10,17 @@ OpenPGP.js [
|
||||
- [Getting started](#getting-started)
|
||||
- [Node.js](#nodejs)
|
||||
- [Deno (experimental)](#deno-experimental)
|
||||
- [Browser (webpack)](#browser-webpack)
|
||||
- [Browser (plain files)](#browser-plain-files)
|
||||
- [Examples](#examples)
|
||||
- [Encrypt and decrypt *Uint8Array* data with a password](#encrypt-and-decrypt-uint8array-data-with-a-password)
|
||||
- [Encrypt and decrypt *String* data with PGP keys](#encrypt-and-decrypt-string-data-with-pgp-keys)
|
||||
- [Encrypt with compression](#encrypt-with-compression)
|
||||
- [Encrypt symmetrically with compression](#encrypt-symmetrically-with-compression)
|
||||
- [Streaming encrypt *Uint8Array* data with a password](#streaming-encrypt-uint8array-data-with-a-password)
|
||||
- [Streaming encrypt and decrypt *String* data with PGP keys](#streaming-encrypt-and-decrypt-string-data-with-pgp-keys)
|
||||
- [Generate new key pair](#generate-new-key-pair)
|
||||
- [Revoke a key](#revoke-a-key)
|
||||
- [Lookup public key on HKP server](#lookup-public-key-on-hkp-server)
|
||||
- [Upload public key to HKP server](#upload-public-key-to-hkp-server)
|
||||
- [Sign and verify cleartext messages](#sign-and-verify-cleartext-messages)
|
||||
- [Create and verify *detached* signatures](#create-and-verify-detached-signatures)
|
||||
- [Streaming sign and verify *Uint8Array* data](#streaming-sign-and-verify-uint8array-data)
|
||||
@ -34,61 +33,62 @@ OpenPGP.js [ bundle works with recent versions of Chrome, Firefox, Edge and Safari 14+.
|
||||
|
||||
* The `dist/node/openpgp.min.js` bundle works well in Node.js. It is used by default when you `require('openpgp')` in Node.js.
|
||||
* The `dist/node/openpgp.min.mjs` (or `.cjs`) bundle works in Node.js v18+: it is used by default when you `import ... from 'openpgp'` (or `require('openpgp')`, respectively).
|
||||
|
||||
* Support for the [Web Cryptography API](https://w3c.github.io/webcrypto/)'s `SubtleCrypto` is required.
|
||||
* In browsers, `SubtleCrypto` is only available in [secure contexts](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).
|
||||
* In supported versions of Node.js, `SubtleCrypto` is always available.
|
||||
|
||||
* Support for the [Web Streams API](https://streams.spec.whatwg.org/) is required.
|
||||
* In browsers: the latest versions of Chrome, Firefox, Edge and Safari support Streams, including `TransformStream`s.
|
||||
These are needed if you use the library with stream inputs.
|
||||
In previous versions of OpenPGP.js, Web Streams were automatically polyfilled by the library,
|
||||
but from v6 this task is left up to the library user, due to the more extensive browser support, and the
|
||||
polyfilling side-effects. If you're working with [older browsers versions which do not implement e.g. TransformStreams](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream#browser_compatibility), you can manually
|
||||
load the [Web Streams polyfill](https://github.com/MattiasBuelens/web-streams-polyfills).
|
||||
Please note that when you load the polyfills, the global `ReadableStream` property (if it exists) gets overwritten with the polyfill version.
|
||||
In some edge cases, you might need to use the native
|
||||
`ReadableStream` (for example when using it to create a `Response`
|
||||
object), in which case you should store a reference to it before loading
|
||||
the polyfills. There is also the [web-streams-adapter](https://github.com/MattiasBuelens/web-streams-adapter)
|
||||
library to convert back and forth between them.
|
||||
* In Node.js: OpenPGP.js v6 no longer supports native Node `Readable` streams in inputs, and instead expects (and outputs) [Node's Web Streams](https://nodejs.org/api/webstreams.html#class-readablestream). [Node v17+ includes utilities to convert from and to Web Streams](https://nodejs.org/api/stream.html#streamreadabletowebstreamreadable-options).
|
||||
|
||||
* Currently, Chrome, Safari and Edge have partial implementations of the
|
||||
[Streams specification](https://streams.spec.whatwg.org/), and Firefox
|
||||
has a partial implementation behind feature flags. Chrome is the only
|
||||
browser that implements `TransformStream`s, which we need, so we include
|
||||
a [polyfill](https://github.com/MattiasBuelens/web-streams-polyfill) for
|
||||
all other browsers. Please note that in those browsers, the global
|
||||
`ReadableStream` property gets overwritten with the polyfill version if
|
||||
it exists. In some edge cases, you might need to use the native
|
||||
`ReadableStream` (for example when using it to create a `Response`
|
||||
object), in which case you should store a reference to it before loading
|
||||
OpenPGP.js. There is also the
|
||||
[web-streams-adapter](https://github.com/MattiasBuelens/web-streams-adapter)
|
||||
library to convert back and forth between them.
|
||||
|
||||
### Performance
|
||||
|
||||
* Version 3.0.0 of the library introduces support for public-key cryptography using [elliptic curves](https://wiki.gnupg.org/ECC). We use native implementations on browsers and Node.js when available. Elliptic curve cryptography provides stronger security per bits of key, which allows for much faster operations. Currently the following curves are supported:
|
||||
* Version 3.0.0 of the library introduced support for public-key cryptography using [elliptic curves](https://wiki.gnupg.org/ECC). We use native implementations on browsers and Node.js when available. Compared to RSA, elliptic curve cryptography provides stronger security per bits of key, which allows for much faster operations. Currently the following curves are supported:
|
||||
|
||||
| Curve | Encryption | Signature | NodeCrypto | WebCrypto | Constant-Time |
|
||||
|:---------------:|:----------:|:---------:|:----------:|:---------:|:-----------------:|
|
||||
| curve25519 | ECDH | N/A | No | No | Algorithmically** |
|
||||
| ed25519 | N/A | EdDSA | No | No | Algorithmically** |
|
||||
| p256 | ECDH | ECDSA | Yes* | Yes* | If native*** |
|
||||
| p384 | ECDH | ECDSA | Yes* | Yes* | If native*** |
|
||||
| p521 | ECDH | ECDSA | Yes* | Yes* | If native*** |
|
||||
| brainpoolP256r1 | ECDH | ECDSA | Yes* | No | If native*** |
|
||||
| brainpoolP384r1 | ECDH | ECDSA | Yes* | No | If native*** |
|
||||
| brainpoolP512r1 | ECDH | ECDSA | Yes* | No | If native*** |
|
||||
| secp256k1 | ECDH | ECDSA | Yes* | No | If native*** |
|
||||
| curve25519 | ECDH | N/A | No | No | Algorithmically |
|
||||
| ed25519 | N/A | EdDSA | No | Yes* | If native** |
|
||||
| nistP256 | ECDH | ECDSA | Yes* | Yes* | If native** |
|
||||
| nistP384 | ECDH | ECDSA | Yes* | Yes* | If native** |
|
||||
| nistP521 | ECDH | ECDSA | Yes* | Yes* | If native** |
|
||||
| brainpoolP256r1 | ECDH | ECDSA | Yes* | No | If native** |
|
||||
| brainpoolP384r1 | ECDH | ECDSA | Yes* | No | If native** |
|
||||
| brainpoolP512r1 | ECDH | ECDSA | Yes* | No | If native** |
|
||||
| secp256k1 | ECDH | ECDSA | Yes* | No | If native** |
|
||||
|
||||
\* when available
|
||||
\** the curve25519 and ed25519 implementations are algorithmically constant-time, but may not be constant-time after optimizations of the JavaScript compiler
|
||||
\*** these curves are only constant-time if the underlying native implementation is available and constant-time
|
||||
\** these curves are only constant-time if the underlying native implementation is available and constant-time
|
||||
|
||||
* Version 2.x of the library has been built from the ground up with Uint8Arrays. This allows for much better performance and memory usage than strings.
|
||||
* The platform's [native Web Crypto API](https://w3c.github.io/webcrypto/) is used for performance. On Node.js the native [crypto module](https://nodejs.org/api/crypto.html#crypto_crypto) is also used, in cases where it offers additional functionality.
|
||||
|
||||
* If the user's browser supports [native WebCrypto](https://caniuse.com/#feat=cryptography) via the `window.crypto.subtle` API, this will be used. Under Node.js the native [crypto module](https://nodejs.org/api/crypto.html#crypto_crypto) is used.
|
||||
|
||||
* The library implements the [IETF proposal](https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-10) for authenticated encryption using native AES-EAX, OCB, or GCM. This makes symmetric encryption up to 30x faster on supported platforms. Since the specification has not been finalized and other OpenPGP implementations haven't adopted it yet, the feature is currently behind a flag. **Note: activating this setting can break compatibility with other OpenPGP implementations, and also with future versions of OpenPGP.js. Don't use it with messages you want to store on disk or in a database.** You can enable it by setting `openpgp.config.aeadProtect = true`.
|
||||
* The library implements authenticated encryption (AEAD) as per [RFC 9580](https://datatracker.ietf.org/doc/rfc9580/) using AES-GCM, OCB, or EAX. This makes symmetric encryption faster on platforms with native implementations. However, since the specification is very recent and other OpenPGP implementations are in the process of adopting it, the feature is currently behind a flag. **Note: activating this setting can break compatibility with other OpenPGP implementations which have yet to implement the feature.** You can enable it by setting `openpgp.config.aeadProtect = true`.
|
||||
Note that this setting has a different effect from the one in OpenPGP.js v5, which implemented support for a provisional version of AEAD from [RFC 4880bis](https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-10), which was modified in RFC 9580.
|
||||
|
||||
You can change the AEAD mode by setting one of the following options:
|
||||
|
||||
```
|
||||
openpgp.config.aeadMode = openpgp.enums.aead.eax // Default, native
|
||||
openpgp.config.aeadMode = openpgp.enums.aead.ocb // Non-native
|
||||
openpgp.config.aeadMode = openpgp.enums.aead.experimentalGcm // **Non-standard**, fastest
|
||||
openpgp.config.preferredAEADAlgorithm = openpgp.enums.aead.gcm; // Default, native in WebCrypto and Node.js
|
||||
openpgp.config.preferredAEADAlgorithm = openpgp.enums.aead.ocb; // Non-native, but supported across RFC 9580 implementations
|
||||
openpgp.config.preferredAEADAlgorithm = openpgp.enums.aead.eax; // Native in Node.js
|
||||
```
|
||||
|
||||
* For environments that don't provide native crypto, the library falls back to [asm.js](https://caniuse.com/#feat=asmjs) implementations of AES, SHA-1, and SHA-256.
|
||||
|
||||
|
||||
### Getting started
|
||||
|
||||
#### Node.js
|
||||
@ -99,16 +99,23 @@ Install OpenPGP.js using npm and save it in your dependencies:
|
||||
npm install --save openpgp
|
||||
```
|
||||
|
||||
And import it as a CommonJS module:
|
||||
And import it as an ES module, from a .mjs file:
|
||||
```js
|
||||
import * as openpgp from 'openpgp';
|
||||
```
|
||||
|
||||
Or as a CommonJS module:
|
||||
|
||||
```js
|
||||
const openpgp = require('openpgp');
|
||||
```
|
||||
|
||||
Or as an ES6 module, from an .mjs file:
|
||||
#### Deno (experimental)
|
||||
|
||||
Import as an ES6 module, using /dist/openpgp.mjs.
|
||||
|
||||
```js
|
||||
import * as openpgp from 'openpgp';
|
||||
import * as openpgp from './openpgpjs/dist/openpgp.mjs';
|
||||
```
|
||||
|
||||
#### Browser (webpack)
|
||||
@ -141,7 +148,7 @@ To test whether the lazy loading works, try to generate a key with a non-standar
|
||||
|
||||
```js
|
||||
import { generateKey } from 'openpgp/lightweight';
|
||||
await generateKey({ curve: 'brainpoolP512r1', userIds: [{ name: 'Test', email: 'test@test.com' }] });
|
||||
await generateKey({ curve: 'brainpoolP512r1', userIDs: [{ name: 'Test', email: 'test@test.com' }] });
|
||||
```
|
||||
|
||||
For more examples of how to generate a key, see [Generate new key pair](#generate-new-key-pair). It is recommended to use `curve25519` instead of `brainpoolP512r1` by default.
|
||||
@ -165,21 +172,31 @@ import * as openpgp from './openpgp.min.mjs';
|
||||
|
||||
To offload cryptographic operations off the main thread, you can implement a Web Worker in your application and load OpenPGP.js from there. For an example Worker implementation, see `test/worker/worker_example.js`.
|
||||
|
||||
#### TypeScript
|
||||
|
||||
Since TS is not fully integrated in the library, TS-only dependencies are currently listed as `devDependencies`, so to compile the project you’ll need to add `@openpgp/web-stream-tools` manually:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @openpgp/web-stream-tools
|
||||
```
|
||||
|
||||
If you notice missing or incorrect type definitions, feel free to open a PR.
|
||||
|
||||
### Examples
|
||||
|
||||
Here are some examples of how to use OpenPGP.js v5. For more elaborate examples and working code, please check out the [public API unit tests](https://github.com/openpgpjs/openpgpjs/blob/master/test/general/openpgp.js). If you're upgrading from v4 it might help to check out the [changelog](https://github.com/openpgpjs/openpgpjs/wiki/V5-Changelog) and [documentation](https://github.com/openpgpjs/openpgpjs#documentation).
|
||||
Here are some examples of how to use OpenPGP.js v6. For more elaborate examples and working code, please check out the [public API unit tests](https://github.com/openpgpjs/openpgpjs/blob/main/test/general/openpgp.js). If you're upgrading from v4 it might help to check out the [changelog](https://github.com/openpgpjs/openpgpjs/wiki/v6-Changelog) and [documentation](https://github.com/openpgpjs/openpgpjs#documentation).
|
||||
|
||||
#### Encrypt and decrypt *Uint8Array* data with a password
|
||||
|
||||
Encryption will use the algorithm specified in config.encryptionCipher (defaults to aes256), and decryption will use the algorithm used for encryption.
|
||||
Encryption will use the algorithm specified in config.preferredSymmetricAlgorithm (defaults to aes256), and decryption will use the algorithm used for encryption.
|
||||
|
||||
```js
|
||||
(async () => {
|
||||
const message = openpgp.Message.fromBinary(new Uint8Array([0x01, 0x01, 0x01]));
|
||||
const message = await openpgp.createMessage({ binary: new Uint8Array([0x01, 0x01, 0x01]) });
|
||||
const encrypted = await openpgp.encrypt({
|
||||
message, // input as Message object
|
||||
passwords: ['secret stuff'], // multiple passwords possible
|
||||
armor: false // don't ASCII armor (for Uint8Array output)
|
||||
format: 'binary' // don't ASCII armor (for Uint8Array output)
|
||||
});
|
||||
console.log(encrypted); // Uint8Array
|
||||
|
||||
@ -197,7 +214,7 @@ Encryption will use the algorithm specified in config.encryptionCipher (defaults
|
||||
|
||||
#### Encrypt and decrypt *String* data with PGP keys
|
||||
|
||||
Encryption will use the algorithm preferred by the public key (defaults to aes256 for keys generated in OpenPGP.js), and decryption will use the algorithm used for encryption.
|
||||
Encryption will use the algorithm preferred by the public (encryption) key (defaults to aes256 for keys generated in OpenPGP.js), and decryption will use the algorithm used for encryption.
|
||||
|
||||
```js
|
||||
const openpgp = require('openpgp'); // use as CommonJS, AMD, ES6 module or via window.openpgp
|
||||
@ -214,29 +231,38 @@ const openpgp = require('openpgp'); // use as CommonJS, AMD, ES6 module or via w
|
||||
|
||||
const publicKey = await openpgp.readKey({ armoredKey: publicKeyArmored });
|
||||
|
||||
const privateKey = await openpgp.readKey({ armoredKey: privateKeyArmored });
|
||||
await privateKey.decrypt(passphrase);
|
||||
const privateKey = await openpgp.decryptKey({
|
||||
privateKey: await openpgp.readPrivateKey({ armoredKey: privateKeyArmored }),
|
||||
passphrase
|
||||
});
|
||||
|
||||
const encrypted = await openpgp.encrypt({
|
||||
message: openpgp.Message.fromText('Hello, World!'), // input as Message object
|
||||
publicKeys: publicKey, // for encryption
|
||||
privateKeys: privateKey // for signing (optional)
|
||||
message: await openpgp.createMessage({ text: 'Hello, World!' }), // input as Message object
|
||||
encryptionKeys: publicKey,
|
||||
signingKeys: privateKey // optional
|
||||
});
|
||||
console.log(encrypted); // '-----BEGIN PGP MESSAGE ... END PGP MESSAGE-----'
|
||||
|
||||
const message = await openpgp.readMessage({
|
||||
armoredMessage: encrypted // parse armored message
|
||||
});
|
||||
const { data: decrypted } = await openpgp.decrypt({
|
||||
const { data: decrypted, signatures } = await openpgp.decrypt({
|
||||
message,
|
||||
publicKeys: publicKey, // for verification (optional)
|
||||
privateKeys: privateKey // for decryption
|
||||
verificationKeys: publicKey, // optional
|
||||
decryptionKeys: privateKey
|
||||
});
|
||||
console.log(decrypted); // 'Hello, World!'
|
||||
// check signature validity (signed messages only)
|
||||
try {
|
||||
await signatures[0].verified; // throws on invalid signature
|
||||
console.log('Signature is valid');
|
||||
} catch (e) {
|
||||
throw new Error('Signature could not be verified: ' + e.message);
|
||||
}
|
||||
})();
|
||||
```
|
||||
|
||||
Encrypt with multiple public keys:
|
||||
Encrypt to multiple public keys:
|
||||
|
||||
```js
|
||||
(async () => {
|
||||
@ -252,91 +278,119 @@ Encrypt with multiple public keys:
|
||||
...
|
||||
-----END PGP PRIVATE KEY BLOCK-----`; // encrypted private key
|
||||
const passphrase = `yourPassphrase`; // what the private key is encrypted with
|
||||
const message = 'Hello, World!';
|
||||
const plaintext = 'Hello, World!';
|
||||
|
||||
const publicKeys = await Promise.all(publicKeysArmored.map(armoredKey => openpgp.readKey({ armoredKey })));
|
||||
|
||||
const privateKey = await openpgp.readKey({ armoredKey: privateKeyArmored });
|
||||
await privateKey.decrypt(passphrase)
|
||||
const privateKey = await openpgp.decryptKey({
|
||||
privateKey: await openpgp.readKey({ armoredKey: privateKeyArmored }),
|
||||
passphrase
|
||||
});
|
||||
|
||||
const message = openpgp.Message.fromText(message);
|
||||
const message = await openpgp.createMessage({ text: plaintext });
|
||||
const encrypted = await openpgp.encrypt({
|
||||
message:, // input as Message object
|
||||
publicKeys, // for encryption
|
||||
privateKeys: privateKey // for signing (optional)
|
||||
message, // input as Message object
|
||||
encryptionKeys: publicKeys,
|
||||
signingKeys: privateKey // optional
|
||||
});
|
||||
console.log(encrypted); // '-----BEGIN PGP MESSAGE ... END PGP MESSAGE-----'
|
||||
})();
|
||||
```
|
||||
|
||||
#### Encrypt with compression
|
||||
If you expect an encrypted message to be signed with one of the public keys you have, and do not want to trust the decrypted data otherwise, you can pass the decryption option `expectSigned = true`, so that the decryption operation will fail if no valid signature is found:
|
||||
```js
|
||||
(async () => {
|
||||
// put keys in backtick (``) to avoid errors caused by spaces or tabs
|
||||
const publicKeyArmored = `-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
...
|
||||
-----END PGP PUBLIC KEY BLOCK-----`;
|
||||
const privateKeyArmored = `-----BEGIN PGP PRIVATE KEY BLOCK-----
|
||||
...
|
||||
-----END PGP PRIVATE KEY BLOCK-----`; // encrypted private key
|
||||
const passphrase = `yourPassphrase`; // what the private key is encrypted with
|
||||
|
||||
By default, `encrypt` will not use any compression. It's possible to override that behavior in two ways:
|
||||
const publicKey = await openpgp.readKey({ armoredKey: publicKeyArmored });
|
||||
|
||||
Either set the `compression` parameter in the options object when calling `encrypt`.
|
||||
const privateKey = await openpgp.decryptKey({
|
||||
privateKey: await openpgp.readPrivateKey({ armoredKey: privateKeyArmored }),
|
||||
passphrase
|
||||
});
|
||||
|
||||
const encryptedAndSignedMessage = `-----BEGIN PGP MESSAGE-----
|
||||
...
|
||||
-----END PGP MESSAGE-----`;
|
||||
|
||||
const message = await openpgp.readMessage({
|
||||
armoredMessage: encryptedAndSignedMessage // parse armored message
|
||||
});
|
||||
// decryption will fail if all signatures are invalid or missing
|
||||
const { data: decrypted, signatures } = await openpgp.decrypt({
|
||||
message,
|
||||
decryptionKeys: privateKey,
|
||||
expectSigned: true,
|
||||
verificationKeys: publicKey, // mandatory with expectSigned=true
|
||||
});
|
||||
console.log(decrypted); // 'Hello, World!'
|
||||
})();
|
||||
```
|
||||
|
||||
#### Encrypt symmetrically with compression
|
||||
|
||||
By default, `encrypt` will not use any compression when encrypting symmetrically only (i.e. when no `encryptionKeys` are given).
|
||||
It's possible to change that behaviour by enabling compression through the config, either for the single encryption:
|
||||
|
||||
```js
|
||||
(async () => {
|
||||
const message = openpgp.Message.fromBinary(new Uint8Array([0x01, 0x02, 0x03])); // or .fromText('string')
|
||||
const message = await openpgp.createMessage({ binary: new Uint8Array([0x01, 0x02, 0x03]) }); // or createMessage({ text: 'string' })
|
||||
const encrypted = await openpgp.encrypt({
|
||||
message,
|
||||
passwords: ['secret stuff'], // multiple passwords possible
|
||||
compression: openpgp.enums.compression.zip // compress the data with zip
|
||||
config: { preferredCompressionAlgorithm: openpgp.enums.compression.zlib } // compress the data with zlib
|
||||
});
|
||||
})();
|
||||
```
|
||||
|
||||
Or, override the config to enable compression:
|
||||
|
||||
or by changing the default global configuration:
|
||||
```js
|
||||
openpgp.config.compression = openpgp.enums.compression.zlib;
|
||||
openpgp.config.preferredCompressionAlgorithm = openpgp.enums.compression.zlib
|
||||
```
|
||||
|
||||
Where the value can be any of:
|
||||
* `openpgp.enums.compression.zip`
|
||||
* `openpgp.enums.compression.zlib`
|
||||
* `openpgp.enums.compression.uncompressed` (default)
|
||||
|
||||
|
||||
|
||||
#### Streaming encrypt *Uint8Array* data with a password
|
||||
|
||||
```js
|
||||
(async () => {
|
||||
const readableStream = new openpgp.stream.ReadableStream({
|
||||
const readableStream = new ReadableStream({
|
||||
start(controller) {
|
||||
controller.enqueue(new Uint8Array([0x01, 0x02, 0x03]));
|
||||
controller.close();
|
||||
}
|
||||
});
|
||||
|
||||
const message = openpgp.Message.fromBinary(readableStream);
|
||||
const message = await openpgp.createMessage({ binary: readableStream });
|
||||
const encrypted = await openpgp.encrypt({
|
||||
message, // input as Message object
|
||||
passwords: ['secret stuff'], // multiple passwords possible
|
||||
armor: false // don't ASCII armor (for Uint8Array output)
|
||||
format: 'binary' // don't ASCII armor (for Uint8Array output)
|
||||
});
|
||||
console.log(encrypted); // raw encrypted packets as ReadableStream<Uint8Array>
|
||||
|
||||
// Either pipe the above stream somewhere, pass it to another function,
|
||||
// or read it manually as follows:
|
||||
const reader = openpgp.stream.getReader(encrypted);
|
||||
while (true) {
|
||||
const { done, value } = await reader.read();
|
||||
if (done) break;
|
||||
console.log('new chunk:', value); // Uint8Array
|
||||
for await (const chunk of encrypted) {
|
||||
console.log('new chunk:', chunk); // Uint8Array
|
||||
}
|
||||
|
||||
// Or, in Node.js, you can pipe the above stream as follows:
|
||||
const nodeStream = openpgp.stream.webToNode(encrypted);
|
||||
nodeStream.pipe(nodeWritableStream);
|
||||
})();
|
||||
```
|
||||
|
||||
For more information on creating ReadableStreams, see [the MDN Documentation on `new
|
||||
ReadableStream()`](https://developer.mozilla.org/docs/Web/API/ReadableStream/ReadableStream).
|
||||
For more information on reading streams using `openpgp.stream`, see the documentation of
|
||||
[the web-stream-tools dependency](https://openpgpjs.org/web-stream-tools/), particularly
|
||||
its [Reader class](https://openpgpjs.org/web-stream-tools/Reader.html).
|
||||
|
||||
For more information on using ReadableStreams (both in browsers and Node.js), see [the MDN Documentation on the
|
||||
Streams API](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) .
|
||||
|
||||
#### Streaming encrypt and decrypt *String* data with PGP keys
|
||||
|
||||
@ -345,17 +399,19 @@ its [Reader class](https://openpgpjs.org/web-stream-tools/Reader.html).
|
||||
const publicKeyArmored = `-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
...
|
||||
-----END PGP PUBLIC KEY BLOCK-----`; // Public key
|
||||
const [privateKeyArmored] = `-----BEGIN PGP PRIVATE KEY BLOCK-----
|
||||
const privateKeyArmored = `-----BEGIN PGP PRIVATE KEY BLOCK-----
|
||||
...
|
||||
-----END PGP PRIVATE KEY BLOCK-----`; // Encrypted private key
|
||||
const passphrase = `yourPassphrase`; // Password that private key is encrypted with
|
||||
|
||||
const publicKey = await openpgp.readKey({ armoredKey: publicKeyArmored });
|
||||
|
||||
const privateKey = await openpgp.readKey({ armoredKey: privateKeyArmored });
|
||||
await privateKey.decrypt(passphrase);
|
||||
const privateKey = await openpgp.decryptKey({
|
||||
privateKey: await openpgp.readPrivateKey({ armoredKey: privateKeyArmored }),
|
||||
passphrase
|
||||
});
|
||||
|
||||
const readableStream = new openpgp.stream.ReadableStream({
|
||||
const readableStream = new ReadableStream({
|
||||
start(controller) {
|
||||
controller.enqueue('Hello, world!');
|
||||
controller.close();
|
||||
@ -363,9 +419,9 @@ its [Reader class](https://openpgpjs.org/web-stream-tools/Reader.html).
|
||||
});
|
||||
|
||||
const encrypted = await openpgp.encrypt({
|
||||
message: openpgp.Message.fromText(readableStream), // input as Message object
|
||||
publicKeys: publicKey, // for encryption
|
||||
privateKeys: privateKey // for signing (optional)
|
||||
message: await openpgp.createMessage({ text: readableStream }), // input as Message object
|
||||
encryptionKeys: publicKey,
|
||||
signingKeys: privateKey // optional
|
||||
});
|
||||
console.log(encrypted); // ReadableStream containing '-----BEGIN PGP MESSAGE ... END PGP MESSAGE-----'
|
||||
|
||||
@ -374,10 +430,14 @@ its [Reader class](https://openpgpjs.org/web-stream-tools/Reader.html).
|
||||
});
|
||||
const decrypted = await openpgp.decrypt({
|
||||
message,
|
||||
publicKeys: publicKey, // for verification (optional)
|
||||
privateKeys: privateKey // for decryption
|
||||
verificationKeys: publicKey, // optional
|
||||
decryptionKeys: privateKey
|
||||
});
|
||||
const plaintext = await openpgp.stream.readToEnd(decrypted.data);
|
||||
const chunks = [];
|
||||
for await (const chunk of decrypted.data) {
|
||||
chunks.push(chunk);
|
||||
}
|
||||
const plaintext = chunks.join('');
|
||||
console.log(plaintext); // 'Hello, World!'
|
||||
})();
|
||||
```
|
||||
@ -387,22 +447,23 @@ its [Reader class](https://openpgpjs.org/web-stream-tools/Reader.html).
|
||||
|
||||
ECC keys (smaller and faster to generate):
|
||||
|
||||
Possible values for `curve` are: `curve25519`, `ed25519`, `p256`, `p384`, `p521`,
|
||||
Possible values for `curve` are: `curve25519`, `ed25519`, `nistP256`, `nistP384`, `nistP521`,
|
||||
`brainpoolP256r1`, `brainpoolP384r1`, `brainpoolP512r1`, and `secp256k1`.
|
||||
Note that both the `curve25519` and `ed25519` options generate a primary key for signing using Ed25519
|
||||
and a subkey for encryption using Curve25519.
|
||||
|
||||
```js
|
||||
(async () => {
|
||||
const { privateKeyArmored, publicKeyArmored, revocationCertificate } = await openpgp.generateKey({
|
||||
const { privateKey, publicKey, revocationCertificate } = await openpgp.generateKey({
|
||||
type: 'ecc', // Type of the key, defaults to ECC
|
||||
curve: 'curve25519', // ECC curve name, defaults to curve25519
|
||||
userIds: [{ name: 'Jon Smith', email: 'jon@example.com' }], // you can pass multiple user IDs
|
||||
passphrase: 'super long and hard to guess secret' // protects the private key
|
||||
userIDs: [{ name: 'Jon Smith', email: 'jon@example.com' }], // you can pass multiple user IDs
|
||||
passphrase: 'super long and hard to guess secret', // protects the private key
|
||||
format: 'armored' // output key format, defaults to 'armored' (other options: 'binary' or 'object')
|
||||
});
|
||||
|
||||
console.log(privateKeyArmored); // '-----BEGIN PGP PRIVATE KEY BLOCK ... '
|
||||
console.log(publicKeyArmored); // '-----BEGIN PGP PUBLIC KEY BLOCK ... '
|
||||
console.log(privateKey); // '-----BEGIN PGP PRIVATE KEY BLOCK ... '
|
||||
console.log(publicKey); // '-----BEGIN PGP PUBLIC KEY BLOCK ... '
|
||||
console.log(revocationCertificate); // '-----BEGIN PGP PUBLIC KEY BLOCK ... '
|
||||
})();
|
||||
```
|
||||
@ -411,10 +472,10 @@ RSA keys (increased compatibility):
|
||||
|
||||
```js
|
||||
(async () => {
|
||||
const key = await openpgp.generateKey({
|
||||
const { privateKey, publicKey } = await openpgp.generateKey({
|
||||
type: 'rsa', // Type of the key
|
||||
rsaBits: 4096, // RSA key size (defaults to 4096 bits)
|
||||
userIds: [{ name: 'Jon Smith', email: 'jon@example.com' }], // you can pass multiple user IDs
|
||||
userIDs: [{ name: 'Jon Smith', email: 'jon@example.com' }], // you can pass multiple user IDs
|
||||
passphrase: 'super long and hard to guess secret' // protects the private key
|
||||
});
|
||||
})();
|
||||
@ -425,9 +486,10 @@ RSA keys (increased compatibility):
|
||||
Using a revocation certificate:
|
||||
```js
|
||||
(async () => {
|
||||
const { publicKeyArmored: revokedKeyArmored } = await openpgp.revokeKey({
|
||||
const { publicKey: revokedKeyArmored } = await openpgp.revokeKey({
|
||||
key: await openpgp.readKey({ armoredKey: publicKeyArmored }),
|
||||
revocationCertificate
|
||||
revocationCertificate,
|
||||
format: 'armored' // output armored keys
|
||||
});
|
||||
console.log(revokedKeyArmored); // '-----BEGIN PGP PUBLIC KEY BLOCK ... '
|
||||
})();
|
||||
@ -436,36 +498,11 @@ Using a revocation certificate:
|
||||
Using the private key:
|
||||
```js
|
||||
(async () => {
|
||||
const { publicKeyArmored, publicKey } = await openpgp.revokeKey({
|
||||
key: await openpgp.readKey({ armoredKey: privateKeyArmored })
|
||||
const { publicKey: revokedKeyArmored } = await openpgp.revokeKey({
|
||||
key: await openpgp.readKey({ armoredKey: privateKeyArmored }),
|
||||
format: 'armored' // output armored keys
|
||||
});
|
||||
})();
|
||||
```
|
||||
|
||||
#### Lookup public key on HKP server
|
||||
|
||||
```js
|
||||
(async () => {
|
||||
var hkp = new openpgp.HKP(); // Defaults to https://keyserver.ubuntu.com, or pass another keyserver URL as a string
|
||||
|
||||
let publicKeyArmored = await hkp.lookup({
|
||||
query: 'alice@example.com'
|
||||
});
|
||||
let publicKey = await openpgp.readKey({ armoredKey: publicKeyArmored });
|
||||
})();
|
||||
```
|
||||
|
||||
#### Upload public key to HKP server
|
||||
|
||||
```js
|
||||
(async () => {
|
||||
var hkp = new openpgp.HKP('https://pgp.mit.edu');
|
||||
|
||||
var publicKeyArmored = `-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
...
|
||||
-----END PGP PUBLIC KEY BLOCK-----`;
|
||||
|
||||
await hkp.upload(publicKeyArmored);
|
||||
console.log(revokedKeyArmored); // '-----BEGIN PGP PUBLIC KEY BLOCK ... '
|
||||
})();
|
||||
```
|
||||
|
||||
@ -483,28 +520,31 @@ Using the private key:
|
||||
|
||||
const publicKey = await openpgp.readKey({ armoredKey: publicKeyArmored });
|
||||
|
||||
const privateKey = await openpgp.readKey({ armoredKey: privateKeyArmored });
|
||||
await privateKey.decrypt(passphrase);
|
||||
const privateKey = await openpgp.decryptKey({
|
||||
privateKey: await openpgp.readPrivateKey({ armoredKey: privateKeyArmored }),
|
||||
passphrase
|
||||
});
|
||||
|
||||
const unsignedMessage = openpgp.CleartextMessage.fromText('Hello, World!');
|
||||
const unsignedMessage = await openpgp.createCleartextMessage({ text: 'Hello, World!' });
|
||||
const cleartextMessage = await openpgp.sign({
|
||||
message: unsignedMessage, // CleartextMessage or Message object
|
||||
privateKeys: privateKey // for signing
|
||||
signingKeys: privateKey
|
||||
});
|
||||
console.log(cleartextMessage); // '-----BEGIN PGP SIGNED MESSAGE ... END PGP SIGNATURE-----'
|
||||
|
||||
const signedMessage = await openpgp.readCleartextMessage({
|
||||
cleartextMessage // parse armored message
|
||||
});
|
||||
const verified = await openpgp.verify({
|
||||
const verificationResult = await openpgp.verify({
|
||||
message: signedMessage,
|
||||
publicKeys: publicKey // for verification
|
||||
verificationKeys: publicKey
|
||||
});
|
||||
const { valid } = verified.signatures[0];
|
||||
if (valid) {
|
||||
console.log('signed by key id ' + verified.signatures[0].keyid.toHex());
|
||||
} else {
|
||||
throw new Error('signature could not be verified');
|
||||
const { verified, keyID } = verificationResult.signatures[0];
|
||||
try {
|
||||
await verified; // throws on invalid signature
|
||||
console.log('Signed by key id ' + keyID.toHex());
|
||||
} catch (e) {
|
||||
throw new Error('Signature could not be verified: ' + e.message);
|
||||
}
|
||||
})();
|
||||
```
|
||||
@ -523,13 +563,15 @@ Using the private key:
|
||||
|
||||
const publicKey = await openpgp.readKey({ armoredKey: publicKeyArmored });
|
||||
|
||||
const privateKey = await openpgp.readKey({ armoredKey: privateKeyArmored });
|
||||
await privateKey.decrypt(passphrase);
|
||||
const privateKey = await openpgp.decryptKey({
|
||||
privateKey: await openpgp.readPrivateKey({ armoredKey: privateKeyArmored }),
|
||||
passphrase
|
||||
});
|
||||
|
||||
const cleartextMessage = openpgp.CleartextMessage.fromText('Hello, World!');
|
||||
const message = await openpgp.createMessage({ text: 'Hello, World!' });
|
||||
const detachedSignature = await openpgp.sign({
|
||||
message: cleartextMessage, // CleartextMessage or Message object
|
||||
privateKeys: privateKey, // for signing
|
||||
message, // Message object
|
||||
signingKeys: privateKey,
|
||||
detached: true
|
||||
});
|
||||
console.log(detachedSignature);
|
||||
@ -537,16 +579,17 @@ Using the private key:
|
||||
const signature = await openpgp.readSignature({
|
||||
armoredSignature: detachedSignature // parse detached signature
|
||||
});
|
||||
const verified = await openpgp.verify({
|
||||
message: cleartextMessage, // CleartextMessage or Message object
|
||||
const verificationResult = await openpgp.verify({
|
||||
message, // Message object
|
||||
signature,
|
||||
publicKeys: publicKey // for verification
|
||||
verificationKeys: publicKey
|
||||
});
|
||||
const { valid } = verified.signatures[0];
|
||||
if (valid) {
|
||||
console.log('signed by key id ' + verified.signatures[0].keyid.toHex());
|
||||
} else {
|
||||
throw new Error('signature could not be verified');
|
||||
const { verified, keyID } = verificationResult.signatures[0];
|
||||
try {
|
||||
await verified; // throws on invalid signature
|
||||
console.log('Signed by key id ' + keyID.toHex());
|
||||
} catch (e) {
|
||||
throw new Error('Signature could not be verified: ' + e.message);
|
||||
}
|
||||
})();
|
||||
```
|
||||
@ -555,7 +598,7 @@ Using the private key:
|
||||
|
||||
```js
|
||||
(async () => {
|
||||
var readableStream = new openpgp.stream.ReadableStream({
|
||||
var readableStream = new ReadableStream({
|
||||
start(controller) {
|
||||
controller.enqueue(new Uint8Array([0x01, 0x02, 0x03]));
|
||||
controller.close();
|
||||
@ -570,38 +613,40 @@ Using the private key:
|
||||
-----END PGP PRIVATE KEY BLOCK-----`; // encrypted private key
|
||||
const passphrase = `yourPassphrase`; // what the private key is encrypted with
|
||||
|
||||
const privateKey = await openpgp.readKey({ armoredKey: privateKeyArmored });
|
||||
await privateKey.decrypt(passphrase);
|
||||
const privateKey = await openpgp.decryptKey({
|
||||
privateKey: await openpgp.readPrivateKey({ armoredKey: privateKeyArmored }),
|
||||
passphrase
|
||||
});
|
||||
|
||||
const message = openpgp.Message.fromBinary(readableStream); // or .fromText(readableStream: ReadableStream<String>)
|
||||
const message = await openpgp.createMessage({ binary: readableStream }); // or createMessage({ text: ReadableStream<String> })
|
||||
const signatureArmored = await openpgp.sign({
|
||||
message,
|
||||
privateKeys: privateKey // for signing
|
||||
signingKeys: privateKey
|
||||
});
|
||||
console.log(signatureArmored); // ReadableStream containing '-----BEGIN PGP MESSAGE ... END PGP MESSAGE-----'
|
||||
|
||||
const verified = await openpgp.verify({
|
||||
const verificationResult = await openpgp.verify({
|
||||
message: await openpgp.readMessage({ armoredMessage: signatureArmored }), // parse armored signature
|
||||
publicKeys: await openpgp.readKey({ armoredKey: publicKeyArmored }) // for verification
|
||||
verificationKeys: await openpgp.readKey({ armoredKey: publicKeyArmored })
|
||||
});
|
||||
|
||||
await openpgp.stream.readToEnd(verified.data);
|
||||
// Note: you *have* to read `verified.data` in some way or other,
|
||||
for await (const chunk of verificationResult.data) {}
|
||||
// Note: you *have* to read `verificationResult.data` in some way or other,
|
||||
// even if you don't need it, as that is what triggers the
|
||||
// verification of the data.
|
||||
|
||||
const { valid } = verified.signatures[0];
|
||||
if (valid) {
|
||||
console.log('signed by key id ' + verified.signatures[0].keyid.toHex());
|
||||
} else {
|
||||
throw new Error('signature could not be verified');
|
||||
try {
|
||||
await verificationResult.signatures[0].verified; // throws on invalid signature
|
||||
console.log('Signed by key id ' + verificationResult.signatures[0].keyID.toHex());
|
||||
} catch (e) {
|
||||
throw new Error('Signature could not be verified: ' + e.message);
|
||||
}
|
||||
})();
|
||||
```
|
||||
|
||||
### Documentation
|
||||
|
||||
The full documentation is available at [openpgpjs.org](https://openpgpjs.org/openpgpjs/).
|
||||
The full documentation is available at [openpgpjs.org](https://docs.openpgpjs.org/).
|
||||
|
||||
### Security Audit
|
||||
|
||||
@ -619,7 +664,7 @@ To create your own build of the library, just run the following command after cl
|
||||
|
||||
npm install && npm test
|
||||
|
||||
For debugging browser errors, you can run `npm start` and open [`http://localhost:8080/test/unittests.html`](http://localhost:8080/test/unittests.html) in a browser, or run the following command:
|
||||
For debugging browser errors, run the following command:
|
||||
|
||||
npm run browsertest
|
||||
|
||||
|
7
SECURITY.md
Normal file
7
SECURITY.md
Normal file
@ -0,0 +1,7 @@
|
||||
## Reporting Security Issues
|
||||
|
||||
**Please do not report security vulnerabilities through public GitHub issues.**
|
||||
|
||||
If you believe you have found a security vulnerability in OpenPGP.js, please report it via email to [security@openpgpjs.org](mailto:security@openpgpjs.org). If possible, encrypt your message with our PGP key: it can be downloaded automatically using [WKD](https://wiki.gnupg.org/WKD), or manually on [openpgpjs.org](https://openpgpjs.org/.well-known/openpgpkey/hu/t5s8ztdbon8yzntexy6oz5y48etqsnbb?l=security).
|
||||
|
||||
You should receive a response within 2 working days.
|
File diff suppressed because one or more lines are too long
986
docs/Argon2S2K.html
Normal file
986
docs/Argon2S2K.html
Normal file
File diff suppressed because one or more lines are too long
1
docs/CNAME
Normal file
1
docs/CNAME
Normal file
@ -0,0 +1 @@
|
||||
docs.openpgpjs.org
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
597
docs/HKP.html
597
docs/HKP.html
@ -1,597 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Class: HKP</title>
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Class: HKP</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
|
||||
<header>
|
||||
|
||||
<h2><span class="attribs"><span class="type-signature"></span></span>HKP<span class="signature">(keyServerBaseUrl, config)</span><span class="type-signature"></span></h2>
|
||||
|
||||
<div class="class-description"><p>This class implements a client for the OpenPGP HTTP Keyserver Protocol (HKP)
|
||||
in order to lookup and upload keys on standard public key servers.</p></div>
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructor</h2>
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="HKP"><span class="type-signature"></span>new HKP<span class="signature">(keyServerBaseUrl, config)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Initialize the HKP client and configure it with the key server url and fetch function.</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>keyServerBaseUrl</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">String</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"><p>(optional) The HKP key server base url including
|
||||
the protocol to use, e.g. 'https://pgp.mit.edu'; defaults to
|
||||
openpgp.config.keyserver (https://keyserver.ubuntu.com)</p></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>config</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">Object</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"><p>(optional) full configuration, defaults to openpgp.config</p></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/hkp.js">hkp.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/hkp.js#L32">line 32</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="subsection-title">Methods</h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="lookup"><span class="type-signature">(async) </span>lookup<span class="signature">()</span><span class="type-signature"> → {Promise.<String>}</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Search for a public key on the key server either by key ID or part of the user ID.</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>options.keyId</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">String</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"><p>The long public key ID.</p></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>options.query</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">String</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"><p>This can be any part of the key user ID such as name
|
||||
or email address.</p></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/hkp.js">hkp.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/hkp.js#L45">line 45</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
<div class="param-desc">
|
||||
<p>The ascii armored public key.</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type">Promise.<String></span>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="upload"><span class="type-signature">(async) </span>upload<span class="signature">(publicKeyArmored)</span><span class="type-signature"> → {Promise}</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Upload a public key to the server.</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>publicKeyArmored</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">String</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"><p>An ascii armored public key to be uploaded.</p></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/hkp.js">hkp.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/hkp.js#L75">line 75</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type">Promise</span>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Functions</h3><ul><li><a href="global.html#armor">armor</a></li><li><a href="global.html#decrypt">decrypt</a></li><li><a href="global.html#decryptKey">decryptKey</a></li><li><a href="global.html#decryptSessionKeys">decryptSessionKeys</a></li><li><a href="global.html#encrypt">encrypt</a></li><li><a href="global.html#encryptKey">encryptKey</a></li><li><a href="global.html#encryptSessionKey">encryptSessionKey</a></li><li><a href="global.html#generateKey">generateKey</a></li><li><a href="global.html#generateSessionKey">generateSessionKey</a></li><li><a href="global.html#readCleartextMessage">readCleartextMessage</a></li><li><a href="global.html#readKey">readKey</a></li><li><a href="global.html#readKeys">readKeys</a></li><li><a href="global.html#readMessage">readMessage</a></li><li><a href="global.html#readSignature">readSignature</a></li><li><a href="global.html#reformatKey">reformatKey</a></li><li><a href="global.html#revokeKey">revokeKey</a></li><li><a href="global.html#sign">sign</a></li><li><a href="global.html#unarmor">unarmor</a></li><li><a href="global.html#verify">verify</a></li></ul><h3>Modules</h3><ul><li><a href="module-config.html">config</a></li><li><a href="module-enums.html">enums</a></li></ul><h3>Classes</h3><ul><li><a href="AEADEncryptedDataPacket.html">AEADEncryptedDataPacket</a></li><li><a href="CleartextMessage.html">CleartextMessage</a></li><li><a href="CompressedDataPacket.html">CompressedDataPacket</a></li><li><a href="HKP.html">HKP</a></li><li><a href="Key.html">Key</a></li><li><a href="KeyArray.html">KeyArray</a></li><li><a href="Keyring.html">Keyring</a></li><li><a href="LiteralDataPacket.html">LiteralDataPacket</a></li><li><a href="MarkerPacket.html">MarkerPacket</a></li><li><a href="Message.html">Message</a></li><li><a href="module-crypto_random-RandomBuffer.html">RandomBuffer</a></li><li><a href="module-key_SubKey-SubKey.html">SubKey</a></li><li><a href="module-key_User-User.html">User</a></li><li><a href="module-type_kdf_params-KDFParams.html">KDFParams</a></li><li><a href="module-type_keyid-Keyid.html">Keyid</a></li><li><a href="module-type_s2k-S2K.html">S2K</a></li><li><a href="OnePassSignaturePacket.html">OnePassSignaturePacket</a></li><li><a href="PacketList.html">PacketList</a></li><li><a href="PublicKeyEncryptedSessionKeyPacket.html">PublicKeyEncryptedSessionKeyPacket</a></li><li><a href="PublicKeyPacket.html">PublicKeyPacket</a></li><li><a href="PublicSubkeyPacket.html">PublicSubkeyPacket</a></li><li><a href="SecretKeyPacket.html">SecretKeyPacket</a></li><li><a href="SecretSubkeyPacket.html">SecretSubkeyPacket</a></li><li><a href="Signature.html">Signature</a></li><li><a href="SignaturePacket.html">SignaturePacket</a></li><li><a href="SymEncryptedIntegrityProtectedDataPacket.html">SymEncryptedIntegrityProtectedDataPacket</a></li><li><a href="SymEncryptedSessionKeyPacket.html">SymEncryptedSessionKeyPacket</a></li><li><a href="SymmetricallyEncryptedDataPacket.html">SymmetricallyEncryptedDataPacket</a></li><li><a href="TrustPacket.html">TrustPacket</a></li><li><a href="UserAttributePacket.html">UserAttributePacket</a></li><li><a href="UserIDPacket.html">UserIDPacket</a></li><li><a href="WKD.html">WKD</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a> on Sat Feb 27 2021 01:25:52 GMT+0100 (Midden-Europese standaardtijd)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
<script src="scripts/linenumber.js"> </script>
|
||||
</body>
|
||||
</html>
|
4073
docs/Key.html
4073
docs/Key.html
File diff suppressed because one or more lines are too long
1062
docs/KeyArray.html
1062
docs/KeyArray.html
File diff suppressed because it is too large
Load Diff
1003
docs/Keyring.html
1003
docs/Keyring.html
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1756
docs/Message.html
1756
docs/Message.html
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
600
docs/PaddingPacket.html
Normal file
600
docs/PaddingPacket.html
Normal file
File diff suppressed because one or more lines are too long
1893
docs/PrivateKey.html
Normal file
1893
docs/PrivateKey.html
Normal file
File diff suppressed because one or more lines are too long
618
docs/PublicKey.html
Normal file
618
docs/PublicKey.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
372
docs/WKD.html
372
docs/WKD.html
@ -1,372 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Class: WKD</title>
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Class: WKD</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
|
||||
<header>
|
||||
|
||||
<h2><span class="attribs"><span class="type-signature"></span></span>WKD<span class="signature">()</span><span class="type-signature"></span></h2>
|
||||
|
||||
<div class="class-description"><p>This class implements a client for the Web Key Directory (WKD) protocol
|
||||
in order to lookup keys on designated servers.</p></div>
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructor</h2>
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="WKD"><span class="type-signature"></span>new WKD<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Initialize the WKD client</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/wkd.js">wkd.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/wkd.js#L31">line 31</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-see">See:</dt>
|
||||
<dd class="tag-see">
|
||||
<ul>
|
||||
<li><a href="https://datatracker.ietf.org/doc/draft-koch-openpgp-webkey-service/">https://datatracker.ietf.org/doc/draft-koch-openpgp-webkey-service/</a></li>
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="subsection-title">Methods</h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="lookup"><span class="type-signature">(async) </span>lookup<span class="signature">()</span><span class="type-signature"> → {Promise.<(Uint8Array|{keys: Array.<<a href="Key.html">Key</a>>, err: (Array.<Error>|null)})>}</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Search for a public key using Web Key Directory protocol.</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>options.email</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">String</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"><p>User's email.</p></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>options.rawBytes</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">Boolean</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"><p>Returns Uint8Array instead of parsed key.</p></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/wkd.js">wkd.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/wkd.js#L44">line 44</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
<div class="param-desc">
|
||||
<p>The public key.</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type">Promise.<(Uint8Array|{keys: Array.<<a href="Key.html">Key</a>>, err: (Array.<Error>|null)})></span>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Functions</h3><ul><li><a href="global.html#armor">armor</a></li><li><a href="global.html#decrypt">decrypt</a></li><li><a href="global.html#decryptKey">decryptKey</a></li><li><a href="global.html#decryptSessionKeys">decryptSessionKeys</a></li><li><a href="global.html#encrypt">encrypt</a></li><li><a href="global.html#encryptKey">encryptKey</a></li><li><a href="global.html#encryptSessionKey">encryptSessionKey</a></li><li><a href="global.html#generateKey">generateKey</a></li><li><a href="global.html#generateSessionKey">generateSessionKey</a></li><li><a href="global.html#readCleartextMessage">readCleartextMessage</a></li><li><a href="global.html#readKey">readKey</a></li><li><a href="global.html#readKeys">readKeys</a></li><li><a href="global.html#readMessage">readMessage</a></li><li><a href="global.html#readSignature">readSignature</a></li><li><a href="global.html#reformatKey">reformatKey</a></li><li><a href="global.html#revokeKey">revokeKey</a></li><li><a href="global.html#sign">sign</a></li><li><a href="global.html#unarmor">unarmor</a></li><li><a href="global.html#verify">verify</a></li></ul><h3>Modules</h3><ul><li><a href="module-config.html">config</a></li><li><a href="module-enums.html">enums</a></li></ul><h3>Classes</h3><ul><li><a href="AEADEncryptedDataPacket.html">AEADEncryptedDataPacket</a></li><li><a href="CleartextMessage.html">CleartextMessage</a></li><li><a href="CompressedDataPacket.html">CompressedDataPacket</a></li><li><a href="HKP.html">HKP</a></li><li><a href="Key.html">Key</a></li><li><a href="KeyArray.html">KeyArray</a></li><li><a href="Keyring.html">Keyring</a></li><li><a href="LiteralDataPacket.html">LiteralDataPacket</a></li><li><a href="MarkerPacket.html">MarkerPacket</a></li><li><a href="Message.html">Message</a></li><li><a href="module-crypto_random-RandomBuffer.html">RandomBuffer</a></li><li><a href="module-key_SubKey-SubKey.html">SubKey</a></li><li><a href="module-key_User-User.html">User</a></li><li><a href="module-type_kdf_params-KDFParams.html">KDFParams</a></li><li><a href="module-type_keyid-Keyid.html">Keyid</a></li><li><a href="module-type_s2k-S2K.html">S2K</a></li><li><a href="OnePassSignaturePacket.html">OnePassSignaturePacket</a></li><li><a href="PacketList.html">PacketList</a></li><li><a href="PublicKeyEncryptedSessionKeyPacket.html">PublicKeyEncryptedSessionKeyPacket</a></li><li><a href="PublicKeyPacket.html">PublicKeyPacket</a></li><li><a href="PublicSubkeyPacket.html">PublicSubkeyPacket</a></li><li><a href="SecretKeyPacket.html">SecretKeyPacket</a></li><li><a href="SecretSubkeyPacket.html">SecretSubkeyPacket</a></li><li><a href="Signature.html">Signature</a></li><li><a href="SignaturePacket.html">SignaturePacket</a></li><li><a href="SymEncryptedIntegrityProtectedDataPacket.html">SymEncryptedIntegrityProtectedDataPacket</a></li><li><a href="SymEncryptedSessionKeyPacket.html">SymEncryptedSessionKeyPacket</a></li><li><a href="SymmetricallyEncryptedDataPacket.html">SymmetricallyEncryptedDataPacket</a></li><li><a href="TrustPacket.html">TrustPacket</a></li><li><a href="UserAttributePacket.html">UserAttributePacket</a></li><li><a href="UserIDPacket.html">UserIDPacket</a></li><li><a href="WKD.html">WKD</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a> on Sat Feb 27 2021 01:25:52 GMT+0100 (Midden-Europese standaardtijd)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
<script src="scripts/linenumber.js"> </script>
|
||||
</body>
|
||||
</html>
|
8579
docs/global.html
8579
docs/global.html
File diff suppressed because one or more lines are too long
403
docs/index.html
403
docs/index.html
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
184
docs/module-crypto.html
Normal file
184
docs/module-crypto.html
Normal file
File diff suppressed because one or more lines are too long
604
docs/module-crypto_aes_kw.html
Normal file
604
docs/module-crypto_aes_kw.html
Normal file
File diff suppressed because one or more lines are too long
400
docs/module-crypto_cipherMode.html
Normal file
400
docs/module-crypto_cipherMode.html
Normal file
File diff suppressed because one or more lines are too long
413
docs/module-crypto_cmac.html
Normal file
413
docs/module-crypto_cmac.html
Normal file
File diff suppressed because one or more lines are too long
2655
docs/module-crypto_crypto.html
Normal file
2655
docs/module-crypto_crypto.html
Normal file
File diff suppressed because one or more lines are too long
525
docs/module-crypto_hash.html
Normal file
525
docs/module-crypto_hash.html
Normal file
File diff suppressed because one or more lines are too long
167
docs/module-crypto_hkdf.html
Normal file
167
docs/module-crypto_hkdf.html
Normal file
File diff suppressed because one or more lines are too long
710
docs/module-crypto_mode_cfb.html
Normal file
710
docs/module-crypto_mode_cfb.html
Normal file
File diff suppressed because one or more lines are too long
748
docs/module-crypto_mode_eax.html
Normal file
748
docs/module-crypto_mode_eax.html
Normal file
File diff suppressed because one or more lines are too long
334
docs/module-crypto_mode_gcm.html
Normal file
334
docs/module-crypto_mode_gcm.html
Normal file
File diff suppressed because one or more lines are too long
747
docs/module-crypto_mode_ocb.html
Normal file
747
docs/module-crypto_mode_ocb.html
Normal file
File diff suppressed because one or more lines are too long
882
docs/module-crypto_pkcs1.html
Normal file
882
docs/module-crypto_pkcs1.html
Normal file
File diff suppressed because one or more lines are too long
167
docs/module-crypto_public_key.html
Normal file
167
docs/module-crypto_public_key.html
Normal file
File diff suppressed because one or more lines are too long
1084
docs/module-crypto_public_key_dsa.html
Normal file
1084
docs/module-crypto_public_key_dsa.html
Normal file
File diff suppressed because one or more lines are too long
981
docs/module-crypto_public_key_elgamal.html
Normal file
981
docs/module-crypto_public_key_elgamal.html
Normal file
File diff suppressed because one or more lines are too long
180
docs/module-crypto_public_key_elliptic.html
Normal file
180
docs/module-crypto_public_key_elliptic.html
Normal file
File diff suppressed because one or more lines are too long
1240
docs/module-crypto_public_key_elliptic_curve.html
Normal file
1240
docs/module-crypto_public_key_elliptic_curve.html
Normal file
File diff suppressed because one or more lines are too long
6517
docs/module-crypto_public_key_elliptic_ecdh.html
Normal file
6517
docs/module-crypto_public_key_elliptic_ecdh.html
Normal file
File diff suppressed because one or more lines are too long
1017
docs/module-crypto_public_key_elliptic_ecdsa.html
Normal file
1017
docs/module-crypto_public_key_elliptic_ecdsa.html
Normal file
File diff suppressed because one or more lines are too long
1106
docs/module-crypto_public_key_elliptic_eddsa.html
Normal file
1106
docs/module-crypto_public_key_elliptic_eddsa.html
Normal file
File diff suppressed because one or more lines are too long
927
docs/module-crypto_public_key_elliptic_eddsa_legacy.html
Normal file
927
docs/module-crypto_public_key_elliptic_eddsa_legacy.html
Normal file
File diff suppressed because one or more lines are too long
2369
docs/module-crypto_public_key_rsa.html
Normal file
2369
docs/module-crypto_public_key_rsa.html
Normal file
File diff suppressed because one or more lines are too long
@ -1,593 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Class: RandomBuffer</title>
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Class: RandomBuffer</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
|
||||
<header>
|
||||
|
||||
<h2><span class="attribs"><span class="type-signature"></span></span>RandomBuffer<span class="signature">()</span><span class="type-signature"></span></h2>
|
||||
|
||||
<div class="class-description"><p>Buffer for secure random numbers</p></div>
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructor</h2>
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="RandomBuffer"><span class="type-signature"></span>new RandomBuffer<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/crypto/random.js">crypto/random.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/crypto/random.js#L33">line 33</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="subsection-title">Methods</h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="get"><span class="type-signature">(async) </span>get<span class="signature">(buf)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Take numbers out of buffer and copy to array</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>buf</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">Uint8Array</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"><p>the destination array</p></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/crypto/random.js">crypto/random.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/crypto/random.js#L73">line 73</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="init"><span class="type-signature"></span>init<span class="signature">(size)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Initialize buffer</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>size</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">Integer</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"><p>size of buffer</p></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/crypto/random.js">crypto/random.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/crypto/random.js#L43">line 43</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="set"><span class="type-signature"></span>set<span class="signature">(buf)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Concat array of secure random numbers to buffer</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>buf</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">Uint8Array</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/crypto/random.js">crypto/random.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/crypto/random.js#L53">line 53</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Functions</h3><ul><li><a href="global.html#armor">armor</a></li><li><a href="global.html#decrypt">decrypt</a></li><li><a href="global.html#decryptKey">decryptKey</a></li><li><a href="global.html#decryptSessionKeys">decryptSessionKeys</a></li><li><a href="global.html#encrypt">encrypt</a></li><li><a href="global.html#encryptKey">encryptKey</a></li><li><a href="global.html#encryptSessionKey">encryptSessionKey</a></li><li><a href="global.html#generateKey">generateKey</a></li><li><a href="global.html#generateSessionKey">generateSessionKey</a></li><li><a href="global.html#readCleartextMessage">readCleartextMessage</a></li><li><a href="global.html#readKey">readKey</a></li><li><a href="global.html#readKeys">readKeys</a></li><li><a href="global.html#readMessage">readMessage</a></li><li><a href="global.html#readSignature">readSignature</a></li><li><a href="global.html#reformatKey">reformatKey</a></li><li><a href="global.html#revokeKey">revokeKey</a></li><li><a href="global.html#sign">sign</a></li><li><a href="global.html#unarmor">unarmor</a></li><li><a href="global.html#verify">verify</a></li></ul><h3>Modules</h3><ul><li><a href="module-config.html">config</a></li><li><a href="module-enums.html">enums</a></li></ul><h3>Classes</h3><ul><li><a href="AEADEncryptedDataPacket.html">AEADEncryptedDataPacket</a></li><li><a href="CleartextMessage.html">CleartextMessage</a></li><li><a href="CompressedDataPacket.html">CompressedDataPacket</a></li><li><a href="HKP.html">HKP</a></li><li><a href="Key.html">Key</a></li><li><a href="KeyArray.html">KeyArray</a></li><li><a href="Keyring.html">Keyring</a></li><li><a href="LiteralDataPacket.html">LiteralDataPacket</a></li><li><a href="MarkerPacket.html">MarkerPacket</a></li><li><a href="Message.html">Message</a></li><li><a href="module-crypto_random-RandomBuffer.html">RandomBuffer</a></li><li><a href="module-key_SubKey-SubKey.html">SubKey</a></li><li><a href="module-key_User-User.html">User</a></li><li><a href="module-type_kdf_params-KDFParams.html">KDFParams</a></li><li><a href="module-type_keyid-Keyid.html">Keyid</a></li><li><a href="module-type_s2k-S2K.html">S2K</a></li><li><a href="OnePassSignaturePacket.html">OnePassSignaturePacket</a></li><li><a href="PacketList.html">PacketList</a></li><li><a href="PublicKeyEncryptedSessionKeyPacket.html">PublicKeyEncryptedSessionKeyPacket</a></li><li><a href="PublicKeyPacket.html">PublicKeyPacket</a></li><li><a href="PublicSubkeyPacket.html">PublicSubkeyPacket</a></li><li><a href="SecretKeyPacket.html">SecretKeyPacket</a></li><li><a href="SecretSubkeyPacket.html">SecretSubkeyPacket</a></li><li><a href="Signature.html">Signature</a></li><li><a href="SignaturePacket.html">SignaturePacket</a></li><li><a href="SymEncryptedIntegrityProtectedDataPacket.html">SymEncryptedIntegrityProtectedDataPacket</a></li><li><a href="SymEncryptedSessionKeyPacket.html">SymEncryptedSessionKeyPacket</a></li><li><a href="SymmetricallyEncryptedDataPacket.html">SymmetricallyEncryptedDataPacket</a></li><li><a href="TrustPacket.html">TrustPacket</a></li><li><a href="UserAttributePacket.html">UserAttributePacket</a></li><li><a href="UserIDPacket.html">UserIDPacket</a></li><li><a href="WKD.html">WKD</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a> on Sat Feb 27 2021 01:25:52 GMT+0100 (Midden-Europese standaardtijd)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
<script src="scripts/linenumber.js"> </script>
|
||||
</body>
|
||||
</html>
|
516
docs/module-crypto_random.html
Normal file
516
docs/module-crypto_random.html
Normal file
File diff suppressed because one or more lines are too long
917
docs/module-crypto_signature.html
Normal file
917
docs/module-crypto_signature.html
Normal file
File diff suppressed because one or more lines are too long
769
docs/module-encoding_base64.html
Normal file
769
docs/module-encoding_base64.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
92
docs/module-key_Subkey.html
Normal file
92
docs/module-key_Subkey.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
92
docs/module-key_User.html
Normal file
92
docs/module-key_User.html
Normal file
File diff suppressed because one or more lines are too long
2891
docs/module-key_helper.html
Normal file
2891
docs/module-key_helper.html
Normal file
File diff suppressed because one or more lines are too long
866
docs/module-packet_packet.html
Normal file
866
docs/module-packet_packet.html
Normal file
File diff suppressed because one or more lines are too long
167
docs/module-type_ecdh_symkey.html
Normal file
167
docs/module-type_ecdh_symkey.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
943
docs/module-type_keyid-KeyID.html
Normal file
943
docs/module-type_keyid-KeyID.html
Normal file
File diff suppressed because one or more lines are too long
@ -1,942 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Class: Keyid</title>
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Class: Keyid</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
|
||||
<header>
|
||||
|
||||
<h2><span class="attribs"><span class="type-signature"></span></span>Keyid<span class="signature">()</span><span class="type-signature"></span></h2>
|
||||
|
||||
<div class="class-description"><p>Implementation of type key id</p>
|
||||
<p><a href="https://tools.ietf.org/html/rfc4880#section-3.3">RFC4880 3.3</a>:
|
||||
A Key ID is an eight-octet scalar that identifies a key.
|
||||
Implementations SHOULD NOT assume that Key IDs are unique. The
|
||||
section "Enhanced Key Formats" below describes how Key IDs are
|
||||
formed.</p></div>
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructor</h2>
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="Keyid"><span class="type-signature"></span>new Keyid<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/keyid.js">type/keyid.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/keyid.js#L35">line 35</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="subsection-title">Methods</h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="equals"><span class="type-signature"></span>equals<span class="signature">(keyid, matchWildcard)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Checks equality of Key ID's</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
<th>Default</th>
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>keyid</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">Keyid</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="default">
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>matchWildcard</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">Boolean</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="default">
|
||||
|
||||
false
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
<td class="description last"><p>Indicates whether to check if either keyid is a wildcard</p></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/keyid.js">type/keyid.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/keyid.js#L68">line 68</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="isNull"><span class="type-signature"></span>isNull<span class="signature">()</span><span class="type-signature"> → {Boolean}</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Checks to see if the Key ID is unset</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/keyid.js">type/keyid.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/keyid.js#L76">line 76</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
<div class="param-desc">
|
||||
<p>true if the Key ID is null</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type">Boolean</span>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="isWildcard"><span class="type-signature"></span>isWildcard<span class="signature">()</span><span class="type-signature"> → {Boolean}</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Checks to see if the Key ID is a "wildcard" Key ID (all zeros)</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/keyid.js">type/keyid.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/keyid.js#L84">line 84</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
<div class="param-desc">
|
||||
<p>true if this is a wildcard Key ID</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type">Boolean</span>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="read"><span class="type-signature"></span>read<span class="signature">(bytes)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Parsing method for a key id</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>bytes</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">Uint8Array</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"><p>Input to read the key id from</p></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/keyid.js">type/keyid.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/keyid.js#L43">line 43</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="toHex"><span class="type-signature"></span>toHex<span class="signature">()</span><span class="type-signature"> → {String}</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Returns the Key ID represented as a hexadecimal string</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/keyid.js">type/keyid.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/keyid.js#L59">line 59</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
<div class="param-desc">
|
||||
<p>Key ID as a hexadecimal string</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type">String</span>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="write"><span class="type-signature"></span>write<span class="signature">()</span><span class="type-signature"> → {Uint8Array}</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Serializes the Key ID</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/keyid.js">type/keyid.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/keyid.js#L51">line 51</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
<div class="param-desc">
|
||||
<p>Key ID as a Uint8Array</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type">Uint8Array</span>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Functions</h3><ul><li><a href="global.html#armor">armor</a></li><li><a href="global.html#decrypt">decrypt</a></li><li><a href="global.html#decryptKey">decryptKey</a></li><li><a href="global.html#decryptSessionKeys">decryptSessionKeys</a></li><li><a href="global.html#encrypt">encrypt</a></li><li><a href="global.html#encryptKey">encryptKey</a></li><li><a href="global.html#encryptSessionKey">encryptSessionKey</a></li><li><a href="global.html#generateKey">generateKey</a></li><li><a href="global.html#generateSessionKey">generateSessionKey</a></li><li><a href="global.html#readCleartextMessage">readCleartextMessage</a></li><li><a href="global.html#readKey">readKey</a></li><li><a href="global.html#readKeys">readKeys</a></li><li><a href="global.html#readMessage">readMessage</a></li><li><a href="global.html#readSignature">readSignature</a></li><li><a href="global.html#reformatKey">reformatKey</a></li><li><a href="global.html#revokeKey">revokeKey</a></li><li><a href="global.html#sign">sign</a></li><li><a href="global.html#unarmor">unarmor</a></li><li><a href="global.html#verify">verify</a></li></ul><h3>Modules</h3><ul><li><a href="module-config.html">config</a></li><li><a href="module-enums.html">enums</a></li></ul><h3>Classes</h3><ul><li><a href="AEADEncryptedDataPacket.html">AEADEncryptedDataPacket</a></li><li><a href="CleartextMessage.html">CleartextMessage</a></li><li><a href="CompressedDataPacket.html">CompressedDataPacket</a></li><li><a href="HKP.html">HKP</a></li><li><a href="Key.html">Key</a></li><li><a href="KeyArray.html">KeyArray</a></li><li><a href="Keyring.html">Keyring</a></li><li><a href="LiteralDataPacket.html">LiteralDataPacket</a></li><li><a href="MarkerPacket.html">MarkerPacket</a></li><li><a href="Message.html">Message</a></li><li><a href="module-crypto_random-RandomBuffer.html">RandomBuffer</a></li><li><a href="module-key_SubKey-SubKey.html">SubKey</a></li><li><a href="module-key_User-User.html">User</a></li><li><a href="module-type_kdf_params-KDFParams.html">KDFParams</a></li><li><a href="module-type_keyid-Keyid.html">Keyid</a></li><li><a href="module-type_s2k-S2K.html">S2K</a></li><li><a href="OnePassSignaturePacket.html">OnePassSignaturePacket</a></li><li><a href="PacketList.html">PacketList</a></li><li><a href="PublicKeyEncryptedSessionKeyPacket.html">PublicKeyEncryptedSessionKeyPacket</a></li><li><a href="PublicKeyPacket.html">PublicKeyPacket</a></li><li><a href="PublicSubkeyPacket.html">PublicSubkeyPacket</a></li><li><a href="SecretKeyPacket.html">SecretKeyPacket</a></li><li><a href="SecretSubkeyPacket.html">SecretSubkeyPacket</a></li><li><a href="Signature.html">Signature</a></li><li><a href="SignaturePacket.html">SignaturePacket</a></li><li><a href="SymEncryptedIntegrityProtectedDataPacket.html">SymEncryptedIntegrityProtectedDataPacket</a></li><li><a href="SymEncryptedSessionKeyPacket.html">SymEncryptedSessionKeyPacket</a></li><li><a href="SymmetricallyEncryptedDataPacket.html">SymmetricallyEncryptedDataPacket</a></li><li><a href="TrustPacket.html">TrustPacket</a></li><li><a href="UserAttributePacket.html">UserAttributePacket</a></li><li><a href="UserIDPacket.html">UserIDPacket</a></li><li><a href="WKD.html">WKD</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a> on Sat Feb 27 2021 01:25:52 GMT+0100 (Midden-Europese standaardtijd)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
<script src="scripts/linenumber.js"> </script>
|
||||
</body>
|
||||
</html>
|
92
docs/module-type_keyid.html
Normal file
92
docs/module-type_keyid.html
Normal file
File diff suppressed because one or more lines are too long
178
docs/module-type_oid.html
Normal file
178
docs/module-type_oid.html
Normal file
File diff suppressed because one or more lines are too long
969
docs/module-type_s2k-GenericS2K.html
Normal file
969
docs/module-type_s2k-GenericS2K.html
Normal file
File diff suppressed because one or more lines are too long
@ -1,945 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Class: S2K</title>
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Class: S2K</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
|
||||
<header>
|
||||
|
||||
<h2><span class="attribs"><span class="type-signature"></span></span>S2K<span class="signature">(config)</span><span class="type-signature"></span></h2>
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="S2K"><span class="type-signature"></span>new S2K<span class="signature">(config)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>config</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">Object</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"><p>(optional) full configuration, defaults to openpgp.config</p></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/s2k.js">type/s2k.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/s2k.js#L40">line 40</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="subsection-title">Members</h3>
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="algorithm"><span class="type-signature"></span>algorithm<span class="type-signature"> :<a href="module-enums.html#.hash">module:enums.hash</a></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Type:</h5>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<span class="param-type"><a href="module-enums.html#.hash">module:enums.hash</a></span>
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/s2k.js">type/s2k.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/s2k.js#L42">line 42</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="c"><span class="type-signature"></span>c<span class="type-signature"> :Integer</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Type:</h5>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<span class="param-type">Integer</span>
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/s2k.js">type/s2k.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/s2k.js#L46">line 46</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="salt"><span class="type-signature"></span>salt<span class="type-signature"> :String</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Eight bytes of salt in a binary string.</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<h5>Type:</h5>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<span class="param-type">String</span>
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/s2k.js">type/s2k.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/s2k.js#L50">line 50</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="type"><span class="type-signature"></span>type<span class="type-signature"> :<a href="module-enums.html#.s2k">module:enums.s2k</a></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Type:</h5>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<span class="param-type"><a href="module-enums.html#.s2k">module:enums.s2k</a></span>
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/s2k.js">type/s2k.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/s2k.js#L44">line 44</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="subsection-title">Methods</h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="produce_key"><span class="type-signature">(async) </span>produce_key<span class="signature">(passphrase)</span><span class="type-signature"> → {Uint8Array}</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Produces a key using the specified passphrase and the defined
|
||||
hashAlgorithm</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>passphrase</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">String</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"><p>Passphrase containing user input</p></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/s2k.js">type/s2k.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/s2k.js#L149">line 149</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
<div class="param-desc">
|
||||
<p>Produced key with a length corresponding to
|
||||
hashAlgorithm hash length</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type">Uint8Array</span>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="read"><span class="type-signature"></span>read<span class="signature">(bytes)</span><span class="type-signature"> → {Integer}</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Parsing function for a string-to-key specifier (<a href="https://tools.ietf.org/html/rfc4880#section-3.7">RFC 4880 3.7</a>).</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>bytes</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">String</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"><p>Payload of string-to-key specifier</p></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/s2k.js">type/s2k.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/s2k.js#L65">line 65</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
<div class="param-desc">
|
||||
<p>Actual length of the object</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type">Integer</span>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="write"><span class="type-signature"></span>write<span class="signature">()</span><span class="type-signature"> → {Uint8Array}</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Serializes s2k information</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/s2k.js">type/s2k.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.0.0-0/src/type/s2k.js#L116">line 116</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
<div class="param-desc">
|
||||
<p>binary representation of s2k</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type">Uint8Array</span>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Functions</h3><ul><li><a href="global.html#armor">armor</a></li><li><a href="global.html#decrypt">decrypt</a></li><li><a href="global.html#decryptKey">decryptKey</a></li><li><a href="global.html#decryptSessionKeys">decryptSessionKeys</a></li><li><a href="global.html#encrypt">encrypt</a></li><li><a href="global.html#encryptKey">encryptKey</a></li><li><a href="global.html#encryptSessionKey">encryptSessionKey</a></li><li><a href="global.html#generateKey">generateKey</a></li><li><a href="global.html#generateSessionKey">generateSessionKey</a></li><li><a href="global.html#readCleartextMessage">readCleartextMessage</a></li><li><a href="global.html#readKey">readKey</a></li><li><a href="global.html#readKeys">readKeys</a></li><li><a href="global.html#readMessage">readMessage</a></li><li><a href="global.html#readSignature">readSignature</a></li><li><a href="global.html#reformatKey">reformatKey</a></li><li><a href="global.html#revokeKey">revokeKey</a></li><li><a href="global.html#sign">sign</a></li><li><a href="global.html#unarmor">unarmor</a></li><li><a href="global.html#verify">verify</a></li></ul><h3>Modules</h3><ul><li><a href="module-config.html">config</a></li><li><a href="module-enums.html">enums</a></li></ul><h3>Classes</h3><ul><li><a href="AEADEncryptedDataPacket.html">AEADEncryptedDataPacket</a></li><li><a href="CleartextMessage.html">CleartextMessage</a></li><li><a href="CompressedDataPacket.html">CompressedDataPacket</a></li><li><a href="HKP.html">HKP</a></li><li><a href="Key.html">Key</a></li><li><a href="KeyArray.html">KeyArray</a></li><li><a href="Keyring.html">Keyring</a></li><li><a href="LiteralDataPacket.html">LiteralDataPacket</a></li><li><a href="MarkerPacket.html">MarkerPacket</a></li><li><a href="Message.html">Message</a></li><li><a href="module-crypto_random-RandomBuffer.html">RandomBuffer</a></li><li><a href="module-key_SubKey-SubKey.html">SubKey</a></li><li><a href="module-key_User-User.html">User</a></li><li><a href="module-type_kdf_params-KDFParams.html">KDFParams</a></li><li><a href="module-type_keyid-Keyid.html">Keyid</a></li><li><a href="module-type_s2k-S2K.html">S2K</a></li><li><a href="OnePassSignaturePacket.html">OnePassSignaturePacket</a></li><li><a href="PacketList.html">PacketList</a></li><li><a href="PublicKeyEncryptedSessionKeyPacket.html">PublicKeyEncryptedSessionKeyPacket</a></li><li><a href="PublicKeyPacket.html">PublicKeyPacket</a></li><li><a href="PublicSubkeyPacket.html">PublicSubkeyPacket</a></li><li><a href="SecretKeyPacket.html">SecretKeyPacket</a></li><li><a href="SecretSubkeyPacket.html">SecretSubkeyPacket</a></li><li><a href="Signature.html">Signature</a></li><li><a href="SignaturePacket.html">SignaturePacket</a></li><li><a href="SymEncryptedIntegrityProtectedDataPacket.html">SymEncryptedIntegrityProtectedDataPacket</a></li><li><a href="SymEncryptedSessionKeyPacket.html">SymEncryptedSessionKeyPacket</a></li><li><a href="SymmetricallyEncryptedDataPacket.html">SymmetricallyEncryptedDataPacket</a></li><li><a href="TrustPacket.html">TrustPacket</a></li><li><a href="UserAttributePacket.html">UserAttributePacket</a></li><li><a href="UserIDPacket.html">UserIDPacket</a></li><li><a href="WKD.html">WKD</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a> on Sat Feb 27 2021 01:25:52 GMT+0100 (Midden-Europese standaardtijd)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
<script src="scripts/linenumber.js"> </script>
|
||||
</body>
|
||||
</html>
|
180
docs/module-type_s2k.html
Normal file
180
docs/module-type_s2k.html
Normal file
File diff suppressed because one or more lines are too long
169
docs/module-type_x25519x448_symkey.html
Normal file
169
docs/module-type_x25519x448_symkey.html
Normal file
File diff suppressed because one or more lines are too long
167
docs/module-util.html
Normal file
167
docs/module-util.html
Normal file
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "openpgp-lightweight",
|
||||
"main": "../dist/lightweight/openpgp.min.mjs",
|
||||
"browser": "../dist/lightweight/openpgp.min.mjs",
|
||||
"types": "../openpgp.d.ts"
|
||||
}
|
||||
|
878
openpgp.d.ts
vendored
878
openpgp.d.ts
vendored
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user