@protontech/openpgp 6.1.0 → 6.1.1-patch.1

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/openpgp.d.ts CHANGED
@@ -10,6 +10,10 @@
10
10
  */
11
11
 
12
12
  import type { WebStream as GenericWebStream, NodeWebStream as GenericNodeWebStream } from '@openpgp/web-stream-tools';
13
+ import enums from './src/enums';
14
+ import config, { type Config, type PartialConfig } from './src/config';
15
+
16
+ export { enums, config, PartialConfig };
13
17
 
14
18
  /* ############## STREAM #################### */
15
19
  type Data = Uint8Array | string;
@@ -316,52 +320,6 @@ export class Message<T extends MaybeStream<Data>> {
316
320
  public appendSignature(detachedSignature: string | Uint8Array, config?: Config): Promise<void>;
317
321
  }
318
322
 
319
-
320
- /* ############## CONFIG #################### */
321
-
322
- interface Config {
323
- preferredHashAlgorithm: enums.hash;
324
- preferredSymmetricAlgorithm: enums.symmetric;
325
- preferredCompressionAlgorithm: enums.compression;
326
- showVersion: boolean;
327
- showComment: boolean;
328
- aeadProtect: boolean;
329
- ignoreSEIPDv2FeatureFlag: boolean;
330
- allowUnauthenticatedMessages: boolean;
331
- allowUnauthenticatedStream: boolean;
332
- allowForwardedMessages: boolean;
333
- minRSABits: number;
334
- passwordCollisionCheck: boolean;
335
- ignoreUnsupportedPackets: boolean;
336
- ignoreMalformedPackets: boolean;
337
- versionString: string;
338
- commentString: string;
339
- allowInsecureDecryptionWithSigningKeys: boolean;
340
- allowInsecureVerificationWithReformattedKeys: boolean;
341
- allowMissingKeyFlags: boolean;
342
- constantTimePKCS1Decryption: boolean;
343
- constantTimePKCS1DecryptionSupportedSymmetricAlgorithms: Set<enums.symmetric>;
344
- v6Keys: boolean;
345
- enableParsingV5Entities: boolean;
346
- preferredAEADAlgorithm: enums.aead;
347
- aeadChunkSizeByte: number;
348
- s2kType: enums.s2k.iterated | enums.s2k.argon2;
349
- s2kIterationCountByte: number;
350
- s2kArgon2Params: { passes: number, parallelism: number; memoryExponent: number; };
351
- maxUserIDLength: number;
352
- knownNotations: string[];
353
- useEllipticFallback: boolean;
354
- rejectHashAlgorithms: Set<enums.hash>;
355
- rejectMessageHashAlgorithms: Set<enums.hash>;
356
- rejectPublicKeyAlgorithms: Set<enums.publicKey>;
357
- rejectCurves: Set<enums.curve>;
358
- }
359
- export const config: Config;
360
-
361
- // PartialConfig has the same properties as Config, but declared as optional.
362
- // This interface is relevant for top-level functions, which accept a subset of configuration options
363
- export interface PartialConfig extends Partial<Config> {}
364
-
365
323
  /* ############## PACKET #################### */
366
324
 
367
325
  export declare abstract class BasePacket {
@@ -749,201 +707,6 @@ export function armor(messagetype: enums.armor, body: object, partindex?: number
749
707
  */
750
708
  export function unarmor(input: string, config?: Config): Promise<{ text: string, data: Stream<Uint8Array>, type: enums.armor }>;
751
709
 
752
- /* ############## v5 ENUMS #################### */
753
-
754
- export namespace enums {
755
- export function read(type: typeof armor, e: armor): armorNames;
756
- export function read(type: typeof compression, e: compression): compressionNames;
757
- export function read(type: typeof hash, e: hash): hashNames;
758
- export function read(type: typeof packet, e: packet): packetNames;
759
- export function read(type: typeof publicKey, e: publicKey): publicKeyNames;
760
- export function read(type: typeof symmetric, e: symmetric): symmetricNames;
761
- export function read(type: typeof keyStatus, e: keyStatus): keyStatusNames;
762
- export function read(type: typeof keyFlags, e: keyFlags): keyFlagsNames;
763
-
764
- export type armorNames = 'multipartSection' | 'multipartLast' | 'signed' | 'message' | 'publicKey' | 'privateKey';
765
- export enum armor {
766
- multipartSection = 0,
767
- multipartLast = 1,
768
- signed = 2,
769
- message = 3,
770
- publicKey = 4,
771
- privateKey = 5,
772
- signature = 6
773
- }
774
-
775
- export enum reasonForRevocation {
776
- noReason = 0, // No reason specified (key revocations or cert revocations)
777
- keySuperseded = 1, // Key is superseded (key revocations)
778
- keyCompromised = 2, // Key material has been compromised (key revocations)
779
- keyRetired = 3, // Key is retired and no longer used (key revocations)
780
- userIDInvalid = 32 // User ID information is no longer valid (cert revocations)
781
- }
782
-
783
- export type compressionNames = 'uncompressed' | 'zip' | 'zlib' | 'bzip2';
784
- export enum compression {
785
- uncompressed = 0,
786
- zip = 1,
787
- zlib = 2,
788
- bzip2 = 3
789
- }
790
-
791
- export type hashNames = 'md5' | 'sha1' | 'ripemd' | 'sha256' | 'sha384' | 'sha512' | 'sha224' | 'sha3_256' | 'sha3_512';
792
- export enum hash {
793
- md5 = 1,
794
- sha1 = 2,
795
- ripemd = 3,
796
- sha256 = 8,
797
- sha384 = 9,
798
- sha512 = 10,
799
- sha224 = 11,
800
- sha3_256 = 12,
801
- sha3_512 = 14
802
- }
803
-
804
- export type packetNames = 'publicKeyEncryptedSessionKey' | 'signature' | 'symEncryptedSessionKey' | 'onePassSignature' | 'secretKey' | 'publicKey' |
805
- 'secretSubkey' | 'compressed' | 'symmetricallyEncrypted' | 'marker' | 'literal' | 'trust' | 'userID' | 'publicSubkey' | 'userAttribute' |
806
- 'symEncryptedIntegrityProtected' | 'modificationDetectionCode' | 'AEADEncryptedDataPacket';
807
- export enum packet {
808
- publicKeyEncryptedSessionKey = 1,
809
- signature = 2,
810
- symEncryptedSessionKey = 3,
811
- onePassSignature = 4,
812
- secretKey = 5,
813
- publicKey = 6,
814
- secretSubkey = 7,
815
- compressedData = 8,
816
- symmetricallyEncryptedData = 9,
817
- marker = 10,
818
- literalData = 11,
819
- trust = 12,
820
- userID = 13,
821
- publicSubkey = 14,
822
- userAttribute = 17,
823
- symEncryptedIntegrityProtectedData = 18,
824
- modificationDetectionCode = 19,
825
- aeadEncryptedData = 20
826
- }
827
-
828
- export type publicKeyNames = 'rsaEncryptSign' | 'rsaEncrypt' | 'rsaSign' | 'elgamal' | 'dsa' | 'ecdh' | 'ecdsa' | 'eddsaLegacy' | 'aedh' | 'aedsa' | 'ed25519' | 'x25519' | 'ed448' | 'x448' | 'pqc_mlkem_x25519' | 'pqc_mldsa_ed25519';
829
- export enum publicKey {
830
- rsaEncryptSign = 1,
831
- rsaEncrypt = 2,
832
- rsaSign = 3,
833
- elgamal = 16,
834
- dsa = 17,
835
- ecdh = 18,
836
- ecdsa = 19,
837
- eddsaLegacy = 22,
838
- aedh = 23,
839
- aedsa = 24,
840
- x25519 = 25,
841
- x448 = 26,
842
- ed25519 = 27,
843
- ed448 = 28,
844
- pqc_mlkem_x25519 = 105,
845
- pqc_mldsa_ed25519 = 107
846
- }
847
-
848
- export enum curve {
849
- /** @deprecated use `nistP256` instead */
850
- p256 = 'nistP256',
851
- nistP256 = 'nistP256',
852
- /** @deprecated use `nistP384` instead */
853
- p384 = 'nistP384',
854
- nistP384 = 'nistP384',
855
- /** @deprecated use `nistP521` instead */
856
- p521 = 'nistP521',
857
- nistP521 = 'nistP521',
858
- /** @deprecated use `ed25519Legacy` instead */
859
- ed25519 = 'ed25519Legacy',
860
- ed25519Legacy = 'ed25519Legacy',
861
- /** @deprecated use `curve25519Legacy` instead */
862
- curve25519 = 'curve25519Legacy',
863
- curve25519Legacy = 'curve25519Legacy',
864
- secp256k1 = 'secp256k1',
865
- brainpoolP256r1 = 'brainpoolP256r1',
866
- brainpoolP384r1 = 'brainpoolP384r1',
867
- brainpoolP512r1 = 'brainpoolP512r1'
868
- }
869
-
870
- export type symmetricNames = 'idea' | 'tripledes' | 'cast5' | 'blowfish' | 'aes128' | 'aes192' | 'aes256' | 'twofish';
871
- export enum symmetric {
872
- idea = 1,
873
- tripledes = 2,
874
- cast5 = 3,
875
- blowfish = 4,
876
- aes128 = 7,
877
- aes192 = 8,
878
- aes256 = 9,
879
- twofish = 10
880
- }
881
-
882
- export type keyStatusNames = 'invalid' | 'expired' | 'revoked' | 'valid' | 'noSelfCert';
883
- export enum keyStatus {
884
- invalid = 0,
885
- expired = 1,
886
- revoked = 2,
887
- valid = 3,
888
- noSelfCert = 4
889
- }
890
-
891
- export type keyFlagsNames = 'certifyKeys' | 'signData' | 'encryptCommunication' | 'encryptStorage' | 'splitPrivateKey' | 'authentication' | 'sharedPrivateKey';
892
- export enum keyFlags {
893
- certifyKeys = 1,
894
- signData = 2,
895
- encryptCommunication = 4,
896
- encryptStorage = 8,
897
- splitPrivateKey = 16,
898
- authentication = 32,
899
- forwardedCommunication = 64,
900
- sharedPrivateKey = 128
901
- }
902
-
903
- export enum signature {
904
- binary = 0,
905
- text = 1,
906
- standalone = 2,
907
- certGeneric = 16,
908
- certPersona = 17,
909
- certCasual = 18,
910
- certPositive = 19,
911
- certRevocation = 48,
912
- subkeyBinding = 24,
913
- keyBinding = 25,
914
- key = 31,
915
- keyRevocation = 32,
916
- subkeyRevocation = 40,
917
- timestamp = 64,
918
- thirdParty = 80
919
- }
920
-
921
- export type aeadNames = 'eax' | 'ocb' | 'gcm';
922
- export enum aead {
923
- eax = 1,
924
- ocb = 2,
925
- gcm = 3,
926
- /** @deprecated use `gcm` instead */
927
- experimentalGCM = 100 // Private algorithm
928
- }
929
-
930
- export type literalFormatNames = 'utf8' | 'binary' | 'text' | 'mime';
931
- export enum literal {
932
- binary = 98,
933
- text = 116,
934
- utf8 = 117,
935
- mime = 109
936
- }
937
-
938
- export enum s2k {
939
- simple = 0,
940
- salted = 1,
941
- iterated = 3,
942
- argon2 = 4,
943
- gnu = 101
944
- }
945
- }
946
-
947
710
  export declare class Argon2S2K {
948
711
  static reloadWasmModule(): void;
949
712
  static ARGON2_WASM_MEMORY_THRESHOLD_RELOAD: number;
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.0",
4
+ "version": "6.1.1-patch.1",
5
5
  "license": "LGPL-3.0+",
6
6
  "homepage": "https://openpgpjs.org/",
7
7
  "engines": {
@@ -112,7 +112,8 @@
112
112
  "web-streams-polyfill": "^4.0.0"
113
113
  },
114
114
  "overrides": {
115
- "@web/dev-server-core": "npm:@openpgp/wtr-dev-server-core@0.7.3-patch.1"
115
+ "@web/dev-server-core": "npm:@openpgp/wtr-dev-server-core@0.7.3-patch.1",
116
+ "@web/test-runner-core": "npm:@openpgp/wtr-test-runner-core@0.13.4-patch.0"
116
117
  },
117
118
  "repository": {
118
119
  "type": "git",