@protontech/openpgp 6.1.1-patch.1 → 6.1.1-patch.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/openpgp.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! OpenPGP.js v6.1.1-patch.1 - 2025-05-14 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
1
+ /*! OpenPGP.js v6.1.1-patch.2 - 2025-05-14 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
2
2
  const globalThis = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
3
3
 
4
4
  function _mergeNamespaces(n, m) {
@@ -1717,7 +1717,7 @@ var config = {
1717
1717
  * @memberof module:config
1718
1718
  * @property {String} versionString A version string to be included in armored messages
1719
1719
  */
1720
- versionString: 'OpenPGP.js 6.1.1-patch.1',
1720
+ versionString: 'OpenPGP.js 6.1.1-patch.2',
1721
1721
  /**
1722
1722
  * @memberof module:config
1723
1723
  * @property {String} commentString A comment string to be included in armored messages
package/openpgp.d.ts CHANGED
@@ -13,7 +13,7 @@ import type { WebStream as GenericWebStream, NodeWebStream as GenericNodeWebStre
13
13
  import enums from './src/enums';
14
14
  import config, { type Config, type PartialConfig } from './src/config';
15
15
 
16
- export { enums, config, PartialConfig };
16
+ export { enums, config, Config, PartialConfig };
17
17
 
18
18
  /* ############## STREAM #################### */
19
19
  type Data = Uint8Array | string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@protontech/openpgp",
3
3
  "description": "OpenPGP.js is a Javascript implementation of the OpenPGP protocol. This is defined in RFC 4880.",
4
- "version": "6.1.1-patch.1",
4
+ "version": "6.1.1-patch.2",
5
5
  "license": "LGPL-3.0+",
6
6
  "homepage": "https://openpgpjs.org/",
7
7
  "engines": {
@@ -39,7 +39,8 @@
39
39
  "files": [
40
40
  "dist/",
41
41
  "lightweight/",
42
- "openpgp.d.ts"
42
+ "openpgp.d.ts",
43
+ "**/*.d.ts"
43
44
  ],
44
45
  "scripts": {
45
46
  "build": "rollup --config",
@@ -0,0 +1,68 @@
1
+ // GPG4Browsers - An OpenPGP implementation in javascript
2
+ // Copyright (C) 2011 Recurity Labs GmbH
3
+ //
4
+ // This library is free software; you can redistribute it and/or
5
+ // modify it under the terms of the GNU Lesser General Public
6
+ // License as published by the Free Software Foundation; either
7
+ // version 3.0 of the License, or (at your option) any later version.
8
+ //
9
+ // This library is distributed in the hope that it will be useful,
10
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ // Lesser General Public License for more details.
13
+ //
14
+ // You should have received a copy of the GNU Lesser General Public
15
+ // License along with this library; if not, write to the Free Software
16
+ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
+
18
+ /**
19
+ * Global configuration values.
20
+ */
21
+
22
+ import enums from '../enums';
23
+
24
+ export interface Config {
25
+ preferredHashAlgorithm: enums.hash;
26
+ preferredSymmetricAlgorithm: enums.symmetric;
27
+ preferredCompressionAlgorithm: enums.compression;
28
+ showVersion: boolean;
29
+ showComment: boolean;
30
+ aeadProtect: boolean;
31
+ ignoreSEIPDv2FeatureFlag: boolean;
32
+ parseAEADEncryptedV4KeysAsLegacy: boolean;
33
+ allowUnauthenticatedMessages: boolean;
34
+ allowUnauthenticatedStream: boolean;
35
+ allowForwardedMessages: boolean;
36
+ minRSABits: number;
37
+ passwordCollisionCheck: boolean;
38
+ ignoreUnsupportedPackets: boolean;
39
+ ignoreMalformedPackets: boolean;
40
+ enforceGrammar: boolean;
41
+ pluggableGrammarErrorReporter: ((errorMessage: string) => any) | null;
42
+ additionalAllowedPackets: Array<{ new(): any }>;
43
+ versionString: string;
44
+ commentString: string;
45
+ allowInsecureDecryptionWithSigningKeys: boolean;
46
+ allowInsecureVerificationWithReformattedKeys: boolean;
47
+ allowMissingKeyFlags: boolean;
48
+ constantTimePKCS1Decryption: boolean;
49
+ constantTimePKCS1DecryptionSupportedSymmetricAlgorithms: Set<enums.symmetric>;
50
+ v6Keys: boolean;
51
+ enableParsingV5Entities: boolean;
52
+ preferredAEADAlgorithm: enums.aead;
53
+ aeadChunkSizeByte: number;
54
+ s2kType: enums.s2k.iterated | enums.s2k.argon2;
55
+ s2kIterationCountByte: number;
56
+ s2kArgon2Params: { passes: number, parallelism: number; memoryExponent: number; };
57
+ maxUserIDLength: number;
58
+ knownNotations: string[];
59
+ nonDeterministicSignaturesViaNotation: boolean;
60
+ useEllipticFallback: boolean;
61
+ rejectHashAlgorithms: Set<enums.hash>;
62
+ rejectMessageHashAlgorithms: Set<enums.hash>;
63
+ rejectPublicKeyAlgorithms: Set<enums.publicKey>;
64
+ rejectCurves: Set<enums.curve>;
65
+ }
66
+
67
+ declare const config: Config;
68
+ export default config;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The config module cannot be written in TS directly for now,
3
+ * since our JSDoc compiler does not support TS.
4
+ */
5
+ import config, { type Config } from './config';
6
+
7
+
8
+ // PartialConfig has the same properties as Config, but declared as optional.
9
+ // This interface is relevant for top-level functions, which accept a subset of configuration options
10
+ interface PartialConfig extends Partial<Config> {}
11
+
12
+ export { Config, PartialConfig };
13
+ export default config;
package/src/enums.d.ts ADDED
@@ -0,0 +1,195 @@
1
+ declare namespace enums {
2
+ export function read(type: typeof armor, e: armor): armorNames;
3
+ export function read(type: typeof compression, e: compression): compressionNames;
4
+ export function read(type: typeof hash, e: hash): hashNames;
5
+ export function read(type: typeof packet, e: packet): packetNames;
6
+ export function read(type: typeof publicKey, e: publicKey): publicKeyNames;
7
+ export function read(type: typeof symmetric, e: symmetric): symmetricNames;
8
+ export function read(type: typeof keyStatus, e: keyStatus): keyStatusNames;
9
+ export function read(type: typeof keyFlags, e: keyFlags): keyFlagsNames;
10
+
11
+ export type armorNames = 'multipartSection' | 'multipartLast' | 'signed' | 'message' | 'publicKey' | 'privateKey';
12
+ export enum armor {
13
+ multipartSection = 0,
14
+ multipartLast = 1,
15
+ signed = 2,
16
+ message = 3,
17
+ publicKey = 4,
18
+ privateKey = 5,
19
+ signature = 6
20
+ }
21
+
22
+ export enum reasonForRevocation {
23
+ noReason = 0, // No reason specified (key revocations or cert revocations)
24
+ keySuperseded = 1, // Key is superseded (key revocations)
25
+ keyCompromised = 2, // Key material has been compromised (key revocations)
26
+ keyRetired = 3, // Key is retired and no longer used (key revocations)
27
+ userIDInvalid = 32 // User ID information is no longer valid (cert revocations)
28
+ }
29
+
30
+ export type compressionNames = 'uncompressed' | 'zip' | 'zlib' | 'bzip2';
31
+ export enum compression {
32
+ uncompressed = 0,
33
+ zip = 1,
34
+ zlib = 2,
35
+ bzip2 = 3
36
+ }
37
+
38
+ export type hashNames = 'md5' | 'sha1' | 'ripemd' | 'sha256' | 'sha384' | 'sha512' | 'sha224' | 'sha3_256' | 'sha3_512';
39
+ export enum hash {
40
+ md5 = 1,
41
+ sha1 = 2,
42
+ ripemd = 3,
43
+ sha256 = 8,
44
+ sha384 = 9,
45
+ sha512 = 10,
46
+ sha224 = 11,
47
+ sha3_256 = 12,
48
+ sha3_512 = 14
49
+ }
50
+
51
+ export type packetNames = 'publicKeyEncryptedSessionKey' | 'signature' | 'symEncryptedSessionKey' | 'onePassSignature' | 'secretKey' | 'publicKey' |
52
+ 'secretSubkey' | 'compressed' | 'symmetricallyEncrypted' | 'marker' | 'literal' | 'trust' | 'userID' | 'publicSubkey' | 'userAttribute' |
53
+ 'symEncryptedIntegrityProtected' | 'modificationDetectionCode' | 'AEADEncryptedDataPacket' | 'padding';
54
+ export enum packet {
55
+ publicKeyEncryptedSessionKey = 1,
56
+ signature = 2,
57
+ symEncryptedSessionKey = 3,
58
+ onePassSignature = 4,
59
+ secretKey = 5,
60
+ publicKey = 6,
61
+ secretSubkey = 7,
62
+ compressedData = 8,
63
+ symmetricallyEncryptedData = 9,
64
+ marker = 10,
65
+ literalData = 11,
66
+ trust = 12,
67
+ userID = 13,
68
+ publicSubkey = 14,
69
+ userAttribute = 17,
70
+ symEncryptedIntegrityProtectedData = 18,
71
+ modificationDetectionCode = 19,
72
+ aeadEncryptedData = 20,
73
+ padding = 21
74
+ }
75
+
76
+ export type publicKeyNames = 'rsaEncryptSign' | 'rsaEncrypt' | 'rsaSign' | 'elgamal' | 'dsa' | 'ecdh' | 'ecdsa' | 'eddsaLegacy' | 'aedh' | 'aedsa' | 'ed25519' | 'x25519' | 'ed448' | 'x448' | 'pqc_mlkem_x25519' | 'pqc_mldsa_ed25519';
77
+ export enum publicKey {
78
+ rsaEncryptSign = 1,
79
+ rsaEncrypt = 2,
80
+ rsaSign = 3,
81
+ elgamal = 16,
82
+ dsa = 17,
83
+ ecdh = 18,
84
+ ecdsa = 19,
85
+ eddsaLegacy = 22,
86
+ aedh = 23,
87
+ aedsa = 24,
88
+ x25519 = 25,
89
+ x448 = 26,
90
+ ed25519 = 27,
91
+ ed448 = 28,
92
+ pqc_mlkem_x25519 = 105,
93
+ pqc_mldsa_ed25519 = 107
94
+ }
95
+
96
+ export enum curve {
97
+ /** @deprecated use `nistP256` instead */
98
+ p256 = 'nistP256',
99
+ nistP256 = 'nistP256',
100
+ /** @deprecated use `nistP384` instead */
101
+ p384 = 'nistP384',
102
+ nistP384 = 'nistP384',
103
+ /** @deprecated use `nistP521` instead */
104
+ p521 = 'nistP521',
105
+ nistP521 = 'nistP521',
106
+ /** @deprecated use `ed25519Legacy` instead */
107
+ ed25519 = 'ed25519Legacy',
108
+ ed25519Legacy = 'ed25519Legacy',
109
+ /** @deprecated use `curve25519Legacy` instead */
110
+ curve25519 = 'curve25519Legacy',
111
+ curve25519Legacy = 'curve25519Legacy',
112
+ secp256k1 = 'secp256k1',
113
+ brainpoolP256r1 = 'brainpoolP256r1',
114
+ brainpoolP384r1 = 'brainpoolP384r1',
115
+ brainpoolP512r1 = 'brainpoolP512r1'
116
+ }
117
+
118
+ export type symmetricNames = 'idea' | 'tripledes' | 'cast5' | 'blowfish' | 'aes128' | 'aes192' | 'aes256' | 'twofish';
119
+ export enum symmetric {
120
+ idea = 1,
121
+ tripledes = 2,
122
+ cast5 = 3,
123
+ blowfish = 4,
124
+ aes128 = 7,
125
+ aes192 = 8,
126
+ aes256 = 9,
127
+ twofish = 10
128
+ }
129
+
130
+ export type keyStatusNames = 'invalid' | 'expired' | 'revoked' | 'valid' | 'noSelfCert';
131
+ export enum keyStatus {
132
+ invalid = 0,
133
+ expired = 1,
134
+ revoked = 2,
135
+ valid = 3,
136
+ noSelfCert = 4
137
+ }
138
+
139
+ export type keyFlagsNames = 'certifyKeys' | 'signData' | 'encryptCommunication' | 'encryptStorage' | 'splitPrivateKey' | 'authentication' | 'sharedPrivateKey';
140
+ export enum keyFlags {
141
+ certifyKeys = 1,
142
+ signData = 2,
143
+ encryptCommunication = 4,
144
+ encryptStorage = 8,
145
+ splitPrivateKey = 16,
146
+ authentication = 32,
147
+ forwardedCommunication = 64,
148
+ sharedPrivateKey = 128
149
+ }
150
+
151
+ export enum signature {
152
+ binary = 0,
153
+ text = 1,
154
+ standalone = 2,
155
+ certGeneric = 16,
156
+ certPersona = 17,
157
+ certCasual = 18,
158
+ certPositive = 19,
159
+ certRevocation = 48,
160
+ subkeyBinding = 24,
161
+ keyBinding = 25,
162
+ key = 31,
163
+ keyRevocation = 32,
164
+ subkeyRevocation = 40,
165
+ timestamp = 64,
166
+ thirdParty = 80
167
+ }
168
+
169
+ export type aeadNames = 'eax' | 'ocb' | 'gcm';
170
+ export enum aead {
171
+ eax = 1,
172
+ ocb = 2,
173
+ gcm = 3,
174
+ /** @deprecated use `gcm` instead */
175
+ experimentalGCM = 100 // Private algorithm
176
+ }
177
+
178
+ export type literalFormatNames = 'utf8' | 'binary' | 'text' | 'mime';
179
+ export enum literal {
180
+ binary = 98,
181
+ text = 116,
182
+ utf8 = 117,
183
+ mime = 109
184
+ }
185
+
186
+ export enum s2k {
187
+ simple = 0,
188
+ salted = 1,
189
+ iterated = 3,
190
+ argon2 = 4,
191
+ gnu = 101
192
+ }
193
+ }
194
+
195
+ export default enums;