@digitaldefiance/ecies-lib 1.1.12 → 1.1.13
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/README.md +7 -0
- package/dist/constants.d.ts +34 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +318 -8
- package/dist/constants.js.map +1 -1
- package/dist/enumerations/ecies-string-key.d.ts +22 -0
- package/dist/enumerations/ecies-string-key.d.ts.map +1 -1
- package/dist/enumerations/ecies-string-key.js +22 -0
- package/dist/enumerations/ecies-string-key.js.map +1 -1
- package/dist/i18n-setup.d.ts +12 -2
- package/dist/i18n-setup.d.ts.map +1 -1
- package/dist/i18n-setup.js +349 -32
- package/dist/i18n-setup.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces/constants.d.ts +29 -2
- package/dist/interfaces/constants.d.ts.map +1 -1
- package/dist/interfaces/index.d.ts +0 -1
- package/dist/interfaces/index.d.ts.map +1 -1
- package/dist/interfaces/index.js +0 -1
- package/dist/interfaces/index.js.map +1 -1
- package/dist/member.js +1 -1
- package/dist/member.js.map +1 -1
- package/dist/services/aes-gcm.d.ts.map +1 -1
- package/dist/services/aes-gcm.js +11 -8
- package/dist/services/aes-gcm.js.map +1 -1
- package/dist/services/ecies/crypto-core.d.ts.map +1 -1
- package/dist/services/ecies/crypto-core.js +15 -8
- package/dist/services/ecies/crypto-core.js.map +1 -1
- package/dist/services/ecies/integration.d.ts.map +1 -1
- package/dist/services/ecies/integration.js +6 -2
- package/dist/services/ecies/integration.js.map +1 -1
- package/dist/services/ecies/multi-recipient.d.ts.map +1 -1
- package/dist/services/ecies/multi-recipient.js +32 -17
- package/dist/services/ecies/multi-recipient.js.map +1 -1
- package/dist/services/ecies/service.d.ts.map +1 -1
- package/dist/services/ecies/service.js +3 -3
- package/dist/services/ecies/service.js.map +1 -1
- package/dist/services/ecies/single-recipient.d.ts.map +1 -1
- package/dist/services/ecies/single-recipient.js +20 -10
- package/dist/services/ecies/single-recipient.js.map +1 -1
- package/dist/services/password-login.d.ts.map +1 -1
- package/dist/services/password-login.js +3 -3
- package/dist/services/password-login.js.map +1 -1
- package/dist/services/pbkdf2.d.ts.map +1 -1
- package/dist/services/pbkdf2.js +5 -5
- package/dist/services/pbkdf2.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -782,6 +782,13 @@ MIT © Digital Defiance
|
|
|
782
782
|
|
|
783
783
|
## ChangeLog
|
|
784
784
|
|
|
785
|
+
### v1.1.13
|
|
786
|
+
|
|
787
|
+
- Upgrade i18n to plugin engine
|
|
788
|
+
- support more core languages
|
|
789
|
+
- add more string messages for errors
|
|
790
|
+
- be more extensible for constants passed into services, etc
|
|
791
|
+
|
|
785
792
|
### v1.1.12
|
|
786
793
|
|
|
787
794
|
- Add MemberTypeValue
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import { IChecksumConsts } from './interfaces';
|
|
1
2
|
import { IConstants } from './interfaces/constants';
|
|
3
|
+
import { DeepPartial } from './types/deep-partial';
|
|
4
|
+
import { IECIESConstants } from './interfaces/ecies-consts';
|
|
5
|
+
import { IPBkdf2Consts } from './interfaces/pbkdf2-consts';
|
|
6
|
+
import { Pbkdf2Profiles } from './pbkdf2-profiles';
|
|
2
7
|
export declare const UINT8_SIZE: number;
|
|
3
8
|
export declare const UINT16_SIZE: number;
|
|
4
9
|
export declare const UINT16_MAX: number;
|
|
@@ -6,9 +11,36 @@ export declare const UINT32_SIZE: number;
|
|
|
6
11
|
export declare const UINT32_MAX: number;
|
|
7
12
|
export declare const UINT64_SIZE: number;
|
|
8
13
|
export declare const UINT64_MAX: bigint;
|
|
14
|
+
export declare const GUID_SIZE: number;
|
|
9
15
|
/**
|
|
10
|
-
*
|
|
16
|
+
* Constants for checksum operations
|
|
17
|
+
* These values are critical for data integrity and MUST NOT be changed
|
|
18
|
+
* in an already established system as it will break all existing checksums.
|
|
11
19
|
*/
|
|
12
|
-
export declare const
|
|
20
|
+
export declare const CHECKSUM: IChecksumConsts;
|
|
21
|
+
export declare const PBKDF2: IPBkdf2Consts;
|
|
22
|
+
export declare const PBKDF2_PROFILES: Pbkdf2Profiles;
|
|
23
|
+
export declare const ECIES: IECIESConstants;
|
|
13
24
|
export declare const Constants: IConstants;
|
|
25
|
+
export type ConfigurationKey = string | symbol;
|
|
26
|
+
export declare function createRuntimeConfiguration(overrides?: DeepPartial<IConstants>, base?: IConstants): IConstants;
|
|
27
|
+
export declare class ConstantsRegistry {
|
|
28
|
+
static readonly DEFAULT_KEY: ConfigurationKey;
|
|
29
|
+
static listKeys(): ConfigurationKey[];
|
|
30
|
+
static has(key: ConfigurationKey): boolean;
|
|
31
|
+
static get(key?: ConfigurationKey): IConstants;
|
|
32
|
+
static create(overrides?: DeepPartial<IConstants>, baseKey?: ConfigurationKey): IConstants;
|
|
33
|
+
static register(key: ConfigurationKey, configOrOverrides?: DeepPartial<IConstants> | IConstants, options?: {
|
|
34
|
+
baseKey?: ConfigurationKey;
|
|
35
|
+
}): IConstants;
|
|
36
|
+
static unregister(key: ConfigurationKey): boolean;
|
|
37
|
+
static clear(): void;
|
|
38
|
+
}
|
|
39
|
+
export declare function getRuntimeConfiguration(key?: ConfigurationKey): IConstants;
|
|
40
|
+
export declare function registerRuntimeConfiguration(key: ConfigurationKey, configOrOverrides?: DeepPartial<IConstants> | IConstants, options?: {
|
|
41
|
+
baseKey?: ConfigurationKey;
|
|
42
|
+
}): IConstants;
|
|
43
|
+
export declare function unregisterRuntimeConfiguration(key: ConfigurationKey): boolean;
|
|
44
|
+
export declare function clearRuntimeConfigurations(): void;
|
|
45
|
+
export { PASSWORD_REGEX, MNEMONIC_REGEX } from './regexes';
|
|
14
46
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,eAAO,MAAM,UAAU,EAAE,MAAmB,CAAC;AAC7C,eAAO,MAAM,WAAW,EAAE,MAAmB,CAAC;AAC9C,eAAO,MAAM,UAAU,EAAE,MAAuB,CAAC;AACjD,eAAO,MAAM,WAAW,EAAE,MAAmB,CAAC;AAC9C,eAAO,MAAM,UAAU,EAAE,MAA4B,CAAC;AACtD,eAAO,MAAM,WAAW,EAAE,MAAmB,CAAC;AAC9C,eAAO,MAAM,UAAU,EAAE,MAAuC,CAAC;AACjE,eAAO,MAAM,SAAS,EAAE,MAAoB,CAAC;AAW7C;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,eAYZ,CAAC;AAEZ,eAAO,MAAM,MAAM,EAAE,aAQV,CAAC;AAEZ,eAAO,MAAM,eAAe,EAAE,cAmBnB,CAAC;AAyBZ,eAAO,MAAM,KAAK,EAAE,eAoElB,CAAC;AAEH,eAAO,MAAM,SAAS,EAAE,UAoCb,CAAC;AAEZ,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,CAAC;AAsK/C,wBAAgB,0BAA0B,CACxC,SAAS,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,EACnC,IAAI,GAAE,UAAsB,GAC3B,UAAU,CAKZ;AAED,qBAAa,iBAAiB;IAC5B,gBAAuB,WAAW,mBAA6B;WAEjD,QAAQ,IAAI,gBAAgB,EAAE;WAI9B,GAAG,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO;WAInC,GAAG,CAAC,GAAG,GAAE,gBAA4C,GAAG,UAAU;WAOlE,MAAM,CAClB,SAAS,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,EACnC,OAAO,GAAE,gBAA4C,GACpD,UAAU;WAKC,QAAQ,CACpB,GAAG,EAAE,gBAAgB,EACrB,iBAAiB,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,UAAU,EACxD,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,gBAAgB,CAAA;KAAE,GACvC,UAAU;WAgBC,UAAU,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO;WAO1C,KAAK,IAAI,IAAI;CAI5B;AAED,wBAAgB,uBAAuB,CACrC,GAAG,GAAE,gBAA4C,GAChD,UAAU,CAEZ;AAED,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,gBAAgB,EACrB,iBAAiB,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,UAAU,EACxD,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,gBAAgB,CAAA;CAAE,GACvC,UAAU,CAEZ;AAED,wBAAgB,8BAA8B,CAC5C,GAAG,EAAE,gBAAgB,GACpB,OAAO,CAET;AAED,wBAAgB,0BAA0B,IAAI,IAAI,CAEjD;AAED,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { ObjectId } from 'bson';
|
|
2
|
+
import { ECIESErrorTypeEnum } from './enumerations';
|
|
3
|
+
import { Pbkdf2ProfileEnum } from './enumerations/pbkdf2-profile';
|
|
4
|
+
import { ECIESError } from './errors/ecies';
|
|
5
|
+
import { getCompatibleEciesEngine } from './i18n-setup';
|
|
2
6
|
import { MNEMONIC_REGEX, PASSWORD_REGEX } from './regexes';
|
|
3
7
|
export const UINT8_SIZE = 1;
|
|
4
8
|
export const UINT16_SIZE = 2;
|
|
@@ -7,16 +11,128 @@ export const UINT32_SIZE = 4;
|
|
|
7
11
|
export const UINT32_MAX = 4294967295;
|
|
8
12
|
export const UINT64_SIZE = 8;
|
|
9
13
|
export const UINT64_MAX = 18446744073709551615n;
|
|
10
|
-
/**
|
|
11
|
-
* Standard size of a UUID v4 in bytes.
|
|
12
|
-
*/
|
|
13
14
|
export const GUID_SIZE = 16;
|
|
14
15
|
const objectIdLength = new ObjectId().toHexString().length / 2;
|
|
15
|
-
|
|
16
|
+
if (objectIdLength !== 12) {
|
|
17
|
+
console.warn('ObjectID length may have changed, breaking encryption', objectIdLength);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Constants for checksum operations
|
|
21
|
+
* These values are critical for data integrity and MUST NOT be changed
|
|
22
|
+
* in an already established system as it will break all existing checksums.
|
|
23
|
+
*/
|
|
24
|
+
export const CHECKSUM = Object.freeze({
|
|
25
|
+
/** Default hash bits for SHA3 */
|
|
26
|
+
SHA3_DEFAULT_HASH_BITS: 512,
|
|
27
|
+
/** Length of a SHA3 checksum buffer in bytes */
|
|
28
|
+
SHA3_BUFFER_LENGTH: 64,
|
|
29
|
+
/** algorithm to use for checksum */
|
|
30
|
+
ALGORITHM: 'sha3-512',
|
|
31
|
+
/** encoding to use for checksum */
|
|
32
|
+
ENCODING: 'hex',
|
|
33
|
+
});
|
|
34
|
+
export const PBKDF2 = Object.freeze({
|
|
35
|
+
ALGORITHM: 'SHA-256',
|
|
36
|
+
SALT_BYTES: 32,
|
|
16
37
|
/**
|
|
17
|
-
*
|
|
38
|
+
* Number of pbkdf2 iterations per second when hashing a password.
|
|
39
|
+
* This is the high-security default for user login operations.
|
|
18
40
|
*/
|
|
19
|
-
|
|
41
|
+
ITERATIONS_PER_SECOND: 1304000,
|
|
42
|
+
});
|
|
43
|
+
export const PBKDF2_PROFILES = Object.freeze({
|
|
44
|
+
[Pbkdf2ProfileEnum.BROWSER_PASSWORD]: Object.freeze({
|
|
45
|
+
hashBytes: 32,
|
|
46
|
+
saltBytes: 64,
|
|
47
|
+
iterations: 2000000,
|
|
48
|
+
algorithm: 'SHA-512',
|
|
49
|
+
}),
|
|
50
|
+
[Pbkdf2ProfileEnum.HIGH_SECURITY]: Object.freeze({
|
|
51
|
+
hashBytes: 64,
|
|
52
|
+
saltBytes: 32,
|
|
53
|
+
iterations: 5000000,
|
|
54
|
+
algorithm: 'SHA-256',
|
|
55
|
+
}),
|
|
56
|
+
[Pbkdf2ProfileEnum.TEST_FAST]: Object.freeze({
|
|
57
|
+
hashBytes: 32,
|
|
58
|
+
saltBytes: 64,
|
|
59
|
+
iterations: 1000,
|
|
60
|
+
algorithm: 'SHA-512',
|
|
61
|
+
}),
|
|
62
|
+
});
|
|
63
|
+
const ECIES_SYMMETRIC_KEY_SIZE = 32;
|
|
64
|
+
const ECIES_PUBLIC_KEY_LENGTH = 65;
|
|
65
|
+
const ECIES_RAW_PUBLIC_KEY_LENGTH = 64;
|
|
66
|
+
const ECIES_IV_SIZE = 16;
|
|
67
|
+
const ECIES_AUTH_TAG_SIZE = 16;
|
|
68
|
+
const ECIES_MULTIPLE_RECIPIENT_ID_SIZE = 16;
|
|
69
|
+
// Define the expected value for SIMPLE.FIXED_OVERHEAD_SIZE
|
|
70
|
+
const expectedSimpleOverhead = UINT8_SIZE + ECIES_PUBLIC_KEY_LENGTH + ECIES_IV_SIZE + ECIES_AUTH_TAG_SIZE;
|
|
71
|
+
// Define the expected value for MULTIPLE.FIXED_OVERHEAD_SIZE
|
|
72
|
+
// Includes: type (1) + IV (16) + auth tag (16) = 33 (no CRC, AES-GCM provides authentication)
|
|
73
|
+
const expectedMultipleOverhead = UINT8_SIZE + ECIES_IV_SIZE + ECIES_AUTH_TAG_SIZE;
|
|
74
|
+
// Update ENCRYPTED_KEY_SIZE to match Simple encryption (no CRC)
|
|
75
|
+
const expectedMultipleEncryptedKeySize = ECIES_PUBLIC_KEY_LENGTH +
|
|
76
|
+
ECIES_IV_SIZE +
|
|
77
|
+
ECIES_AUTH_TAG_SIZE +
|
|
78
|
+
ECIES_SYMMETRIC_KEY_SIZE;
|
|
79
|
+
export const ECIES = Object.freeze({
|
|
80
|
+
/** The elliptic curve to use for all ECDSA operations */
|
|
81
|
+
CURVE_NAME: 'secp256k1',
|
|
82
|
+
/** The primary key derivation path for HD wallets */
|
|
83
|
+
PRIMARY_KEY_DERIVATION_PATH: "m/44'/60'/0'/0/0",
|
|
84
|
+
SYMMETRIC_ALGORITHM_CONFIGURATION: 'aes-256-gcm',
|
|
85
|
+
/** Length of ECDSA signatures in bytes */
|
|
86
|
+
SIGNATURE_SIZE: 64,
|
|
87
|
+
/** Length of raw public keys in bytes (without 0x04 prefix) */
|
|
88
|
+
RAW_PUBLIC_KEY_LENGTH: ECIES_RAW_PUBLIC_KEY_LENGTH,
|
|
89
|
+
/** Length of public keys in bytes (with 0x04 prefix) */
|
|
90
|
+
PUBLIC_KEY_LENGTH: ECIES_PUBLIC_KEY_LENGTH,
|
|
91
|
+
PUBLIC_KEY_MAGIC: 0x04,
|
|
92
|
+
/** Mnemonic strength in bits. This will produce a 32-bit key for ECDSA */
|
|
93
|
+
MNEMONIC_STRENGTH: 256,
|
|
94
|
+
/** Symmetric encryption algorithm configuration */
|
|
95
|
+
SYMMETRIC: Object.freeze({
|
|
96
|
+
ALGORITHM: 'aes',
|
|
97
|
+
MODE: 'gcm',
|
|
98
|
+
KEY_BITS: 256,
|
|
99
|
+
KEY_SIZE: ECIES_SYMMETRIC_KEY_SIZE, // KEY_BITS / 8
|
|
100
|
+
}),
|
|
101
|
+
IV_SIZE: ECIES_IV_SIZE,
|
|
102
|
+
AUTH_TAG_SIZE: ECIES_AUTH_TAG_SIZE,
|
|
103
|
+
MAX_RAW_DATA_SIZE: 9007199254740991, // 2^53 - 1 (max safe integer for JS)
|
|
104
|
+
/**
|
|
105
|
+
* Message encrypts without data length or crc
|
|
106
|
+
*/
|
|
107
|
+
SIMPLE: Object.freeze({
|
|
108
|
+
FIXED_OVERHEAD_SIZE: expectedSimpleOverhead, // type (1) + public key (65) + IV (16) + auth tag (16)
|
|
109
|
+
DATA_LENGTH_SIZE: 0,
|
|
110
|
+
}),
|
|
111
|
+
/**
|
|
112
|
+
* Message encrypts with data length but no CRC (AES-GCM provides authentication)
|
|
113
|
+
*/
|
|
114
|
+
SINGLE: Object.freeze({
|
|
115
|
+
FIXED_OVERHEAD_SIZE: 106, // type (1) + public key (65) + IV (16) + auth tag (16) + data length (8)
|
|
116
|
+
DATA_LENGTH_SIZE: 8,
|
|
117
|
+
}),
|
|
118
|
+
/**
|
|
119
|
+
* Message encrypts for multiple recipients
|
|
120
|
+
*/
|
|
121
|
+
MULTIPLE: Object.freeze({
|
|
122
|
+
FIXED_OVERHEAD_SIZE: expectedMultipleOverhead, // type (1) + IV (16) + auth tag (16), no CRC
|
|
123
|
+
ENCRYPTED_KEY_SIZE: expectedMultipleEncryptedKeySize, // 129
|
|
124
|
+
MAX_RECIPIENTS: 65535,
|
|
125
|
+
RECIPIENT_ID_SIZE: ECIES_MULTIPLE_RECIPIENT_ID_SIZE,
|
|
126
|
+
RECIPIENT_COUNT_SIZE: 2,
|
|
127
|
+
DATA_LENGTH_SIZE: 8,
|
|
128
|
+
}),
|
|
129
|
+
ENCRYPTION_TYPE: Object.freeze({
|
|
130
|
+
SIMPLE: 33,
|
|
131
|
+
SINGLE: 66,
|
|
132
|
+
MULTIPLE: 99,
|
|
133
|
+
}),
|
|
134
|
+
});
|
|
135
|
+
export const Constants = Object.freeze({
|
|
20
136
|
UINT8_SIZE: UINT8_SIZE,
|
|
21
137
|
UINT16_SIZE: UINT16_SIZE,
|
|
22
138
|
UINT16_MAX: UINT16_MAX,
|
|
@@ -26,10 +142,204 @@ export const Constants = Object.freeze({
|
|
|
26
142
|
UINT64_MAX: UINT64_MAX,
|
|
27
143
|
HEX_RADIX: 16,
|
|
28
144
|
GUID_SIZE: GUID_SIZE,
|
|
145
|
+
OBJECT_ID_LENGTH: objectIdLength,
|
|
146
|
+
CHECKSUM: CHECKSUM,
|
|
147
|
+
ECIES: ECIES,
|
|
148
|
+
PBKDF2: PBKDF2,
|
|
149
|
+
PBKDF2_PROFILES: PBKDF2_PROFILES,
|
|
150
|
+
/**
|
|
151
|
+
* Number of rounds for bcrypt hashing. Higher values increase security but also consume more CPU resources.
|
|
152
|
+
*/
|
|
153
|
+
BcryptRounds: 10,
|
|
154
|
+
/**
|
|
155
|
+
* Minimum password length
|
|
156
|
+
*/
|
|
157
|
+
PasswordMinLength: 8,
|
|
158
|
+
/**
|
|
159
|
+
* The regular expression for valid passwords.
|
|
160
|
+
*/
|
|
29
161
|
PasswordRegex: PASSWORD_REGEX,
|
|
162
|
+
/**
|
|
163
|
+
* The regular expression for valid mnemonic phrases.
|
|
164
|
+
* BIP39 - supports 12, 15, 18, 21, or 24 word mnemonics
|
|
165
|
+
*/
|
|
30
166
|
MnemonicRegex: MNEMONIC_REGEX,
|
|
167
|
+
/**
|
|
168
|
+
* Matches a 64-character hexadecimal string (SHA-256).
|
|
169
|
+
*/
|
|
170
|
+
HmacRegex: /^[a-f0-9]{64}$/,
|
|
31
171
|
});
|
|
32
|
-
|
|
33
|
-
|
|
172
|
+
const DEFAULT_CONFIGURATION_KEY = Symbol.for('digitaldefiance.ecies.constants.default');
|
|
173
|
+
function isPlainObject(value) {
|
|
174
|
+
if (value === null) {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
if (typeof value !== 'object') {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
if (Array.isArray(value)) {
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
if (value instanceof RegExp || value instanceof Date) {
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
return Object.getPrototypeOf(value) === Object.prototype;
|
|
187
|
+
}
|
|
188
|
+
function deepClone(input) {
|
|
189
|
+
if (input === null) {
|
|
190
|
+
return input;
|
|
191
|
+
}
|
|
192
|
+
if (Array.isArray(input)) {
|
|
193
|
+
return input.map((item) => deepClone(item));
|
|
194
|
+
}
|
|
195
|
+
if (input instanceof RegExp) {
|
|
196
|
+
return new RegExp(input.source, input.flags);
|
|
197
|
+
}
|
|
198
|
+
if (input instanceof Date) {
|
|
199
|
+
return new Date(input.getTime());
|
|
200
|
+
}
|
|
201
|
+
if (isPlainObject(input)) {
|
|
202
|
+
const result = {};
|
|
203
|
+
for (const [key, value] of Object.entries(input)) {
|
|
204
|
+
result[key] = deepClone(value);
|
|
205
|
+
}
|
|
206
|
+
return result;
|
|
207
|
+
}
|
|
208
|
+
return input;
|
|
209
|
+
}
|
|
210
|
+
function applyOverrides(target, overrides) {
|
|
211
|
+
if (!overrides) {
|
|
212
|
+
return target;
|
|
213
|
+
}
|
|
214
|
+
for (const [key, overrideValue] of Object.entries(overrides)) {
|
|
215
|
+
const typedKey = key;
|
|
216
|
+
if (overrideValue === undefined) {
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
const currentValue = target[typedKey];
|
|
220
|
+
if (isPlainObject(currentValue) && isPlainObject(overrideValue)) {
|
|
221
|
+
target[typedKey] = applyOverrides(currentValue, overrideValue);
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
target[typedKey] = deepClone(overrideValue);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return target;
|
|
228
|
+
}
|
|
229
|
+
function deepFreeze(value) {
|
|
230
|
+
if (value === null || typeof value !== 'object') {
|
|
231
|
+
return value;
|
|
232
|
+
}
|
|
233
|
+
if (Object.isFrozen(value)) {
|
|
234
|
+
return value;
|
|
235
|
+
}
|
|
236
|
+
Object.freeze(value);
|
|
237
|
+
for (const property of Object.getOwnPropertyNames(value)) {
|
|
238
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
239
|
+
const nestedValue = value[property];
|
|
240
|
+
deepFreeze(nestedValue);
|
|
241
|
+
}
|
|
242
|
+
return value;
|
|
243
|
+
}
|
|
244
|
+
function computeMultipleEncryptedKeySize(ecies) {
|
|
245
|
+
return (ecies.PUBLIC_KEY_LENGTH +
|
|
246
|
+
ecies.IV_SIZE +
|
|
247
|
+
ecies.AUTH_TAG_SIZE +
|
|
248
|
+
ecies.SYMMETRIC.KEY_SIZE);
|
|
249
|
+
}
|
|
250
|
+
function validateConstants(config) {
|
|
251
|
+
const checksum = config.CHECKSUM;
|
|
252
|
+
const ecies = config.ECIES;
|
|
253
|
+
if (checksum.SHA3_BUFFER_LENGTH !== checksum.SHA3_DEFAULT_HASH_BITS / 8 ||
|
|
254
|
+
checksum.SHA3_BUFFER_LENGTH !== checksum.SHA3_DEFAULT_HASH_BITS / 8) {
|
|
255
|
+
throw new Error('Invalid checksum constants');
|
|
256
|
+
}
|
|
257
|
+
const expectedEncryptedKeySize = computeMultipleEncryptedKeySize(ecies);
|
|
258
|
+
if (ecies.MULTIPLE.ENCRYPTED_KEY_SIZE !== expectedEncryptedKeySize) {
|
|
259
|
+
throw new ECIESError(ECIESErrorTypeEnum.InvalidECIESMultipleEncryptedKeySize, getCompatibleEciesEngine());
|
|
260
|
+
}
|
|
261
|
+
if (ecies.PUBLIC_KEY_LENGTH !== ecies.RAW_PUBLIC_KEY_LENGTH + 1) {
|
|
262
|
+
throw new ECIESError(ECIESErrorTypeEnum.InvalidECIESPublicKeyLength, getCompatibleEciesEngine());
|
|
263
|
+
}
|
|
264
|
+
if (ecies.MULTIPLE.RECIPIENT_COUNT_SIZE !== UINT16_SIZE) {
|
|
265
|
+
throw new ECIESError(ECIESErrorTypeEnum.InvalidECIESMultipleRecipientCountSize, getCompatibleEciesEngine());
|
|
266
|
+
}
|
|
267
|
+
if (ecies.MULTIPLE.DATA_LENGTH_SIZE !== UINT64_SIZE) {
|
|
268
|
+
throw new ECIESError(ECIESErrorTypeEnum.InvalidECIESMultipleDataLengthSize, getCompatibleEciesEngine());
|
|
269
|
+
}
|
|
270
|
+
if (ecies.MULTIPLE.RECIPIENT_ID_SIZE !== GUID_SIZE) {
|
|
271
|
+
throw new ECIESError(ECIESErrorTypeEnum.InvalidECIESMultipleRecipientIdSize, getCompatibleEciesEngine());
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
validateConstants(Constants);
|
|
275
|
+
const configurationRegistry = new Map();
|
|
276
|
+
configurationRegistry.set(DEFAULT_CONFIGURATION_KEY, Constants);
|
|
277
|
+
function isFullConstantsConfig(value) {
|
|
278
|
+
if (!isPlainObject(value)) {
|
|
279
|
+
return false;
|
|
280
|
+
}
|
|
281
|
+
const candidate = value;
|
|
282
|
+
return (candidate.CHECKSUM !== undefined &&
|
|
283
|
+
candidate.ECIES !== undefined &&
|
|
284
|
+
candidate.PBKDF2 !== undefined &&
|
|
285
|
+
candidate.PBKDF2_PROFILES !== undefined);
|
|
286
|
+
}
|
|
287
|
+
export function createRuntimeConfiguration(overrides, base = Constants) {
|
|
288
|
+
const merged = deepClone(base);
|
|
289
|
+
applyOverrides(merged, overrides);
|
|
290
|
+
validateConstants(merged);
|
|
291
|
+
return deepFreeze(merged);
|
|
292
|
+
}
|
|
293
|
+
export class ConstantsRegistry {
|
|
294
|
+
static DEFAULT_KEY = DEFAULT_CONFIGURATION_KEY;
|
|
295
|
+
static listKeys() {
|
|
296
|
+
return Array.from(configurationRegistry.keys());
|
|
297
|
+
}
|
|
298
|
+
static has(key) {
|
|
299
|
+
return configurationRegistry.has(key);
|
|
300
|
+
}
|
|
301
|
+
static get(key = DEFAULT_CONFIGURATION_KEY) {
|
|
302
|
+
return (configurationRegistry.get(key) ??
|
|
303
|
+
configurationRegistry.get(DEFAULT_CONFIGURATION_KEY));
|
|
304
|
+
}
|
|
305
|
+
static create(overrides, baseKey = DEFAULT_CONFIGURATION_KEY) {
|
|
306
|
+
const baseConfig = ConstantsRegistry.get(baseKey);
|
|
307
|
+
return createRuntimeConfiguration(overrides, baseConfig);
|
|
308
|
+
}
|
|
309
|
+
static register(key, configOrOverrides, options) {
|
|
310
|
+
if (key === DEFAULT_CONFIGURATION_KEY) {
|
|
311
|
+
throw new Error('Cannot overwrite the default configuration');
|
|
312
|
+
}
|
|
313
|
+
const baseKey = options?.baseKey ?? DEFAULT_CONFIGURATION_KEY;
|
|
314
|
+
const baseConfig = ConstantsRegistry.get(baseKey);
|
|
315
|
+
const configuration = isFullConstantsConfig(configOrOverrides)
|
|
316
|
+
? createRuntimeConfiguration(undefined, configOrOverrides)
|
|
317
|
+
: createRuntimeConfiguration(configOrOverrides, baseConfig);
|
|
318
|
+
configurationRegistry.set(key, configuration);
|
|
319
|
+
return configuration;
|
|
320
|
+
}
|
|
321
|
+
static unregister(key) {
|
|
322
|
+
if (key === DEFAULT_CONFIGURATION_KEY) {
|
|
323
|
+
return false;
|
|
324
|
+
}
|
|
325
|
+
return configurationRegistry.delete(key);
|
|
326
|
+
}
|
|
327
|
+
static clear() {
|
|
328
|
+
configurationRegistry.clear();
|
|
329
|
+
configurationRegistry.set(DEFAULT_CONFIGURATION_KEY, Constants);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
export function getRuntimeConfiguration(key = DEFAULT_CONFIGURATION_KEY) {
|
|
333
|
+
return ConstantsRegistry.get(key);
|
|
334
|
+
}
|
|
335
|
+
export function registerRuntimeConfiguration(key, configOrOverrides, options) {
|
|
336
|
+
return ConstantsRegistry.register(key, configOrOverrides, options);
|
|
337
|
+
}
|
|
338
|
+
export function unregisterRuntimeConfiguration(key) {
|
|
339
|
+
return ConstantsRegistry.unregister(key);
|
|
340
|
+
}
|
|
341
|
+
export function clearRuntimeConfigurations() {
|
|
342
|
+
ConstantsRegistry.clear();
|
|
34
343
|
}
|
|
344
|
+
export { PASSWORD_REGEX, MNEMONIC_REGEX } from './regexes';
|
|
35
345
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/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BAAyB;IAEjD,OAAO,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,GAAqB,EACrB,iBAAwD,EACxD,OAAwC;IAExC,OAAO,iBAAiB,CAAC,QAAQ,CAAC,GAAG,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,8BAA8B,CAC5C,GAAqB;IAErB,OAAO,iBAAiB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,0BAA0B;IACxC,iBAAiB,CAAC,KAAK,EAAE,CAAC;AAC5B,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -6,6 +6,7 @@ export declare enum EciesStringKey {
|
|
|
6
6
|
Error_ECIESError_InvalidECIESMultipleRecipientIdSize = "Error_ECIESError_InvalidECIESMultipleRecipientIdSize",
|
|
7
7
|
Error_ECIESError_CRCError = "Error_ECIESError_CRCError",
|
|
8
8
|
Error_ECIESError_InvalidEncryptionType = "Error_ECIESError_InvalidEncryptionType",
|
|
9
|
+
Error_ECIESError_InvalidEncryptionTypeTemplate = "Error_ECIESError_InvalidEncryptionTypeTemplate",
|
|
9
10
|
Error_ECIESError_InvalidIVLength = "Error_ECIESError_InvalidIVLength",
|
|
10
11
|
Error_ECIESError_InvalidAuthTagLength = "Error_ECIESError_InvalidAuthTagLength",
|
|
11
12
|
Error_ECIESError_InvalidHeaderLength = "Error_ECIESError_InvalidHeaderLength",
|
|
@@ -28,6 +29,27 @@ export declare enum EciesStringKey {
|
|
|
28
29
|
Error_ECIESError_DecryptionFailed = "Error_ECIESError_DecryptionFailed",
|
|
29
30
|
Error_ECIESError_InvalidRecipientPublicKey = "Error_ECIESError_InvalidRecipientPublicKey",
|
|
30
31
|
Error_ECIESError_SecretComputationFailed = "Error_ECIESError_SecretComputationFailed",
|
|
32
|
+
Error_ECIESError_AuthenticationTagIsRequiredForKeyEncryption = "Error_ECIESError_AuthenticationTagIsRequiredForKeyEncryption",
|
|
33
|
+
Error_ECIESError_AuthenticationTagIsRequiredForECIESEncryption = "Error_ECIESError_AuthenticationTagIsRequiredForECIESEncryption",
|
|
34
|
+
Error_ECIESError_AuthenticationTagIsRequiredForMultiRecipientECIESEncryption = "Error_ECIESError_AuthenticationTagIsRequiredForMultiRecipientECIESEncryption",
|
|
35
|
+
Error_ECIESError_InvalidEncryptedKeyLengthTemplate = "Error_ECIESError_InvalidEncryptedKeyLengthTemplate",
|
|
36
|
+
Error_ECIESError_FailedToDecryptKey = "Error_ECIESError_FailedToDecryptKey",
|
|
37
|
+
Error_ECIESError_TooManyRecipientsTemplate = "Error_ECIESError_TooManyRecipientsTemplate",
|
|
38
|
+
Error_ECIESError_MessageTooLargeTemplate = "Error_ECIESError_MessageTooLargeTemplate",
|
|
39
|
+
Error_ECIESError_DecryptedDataLengthMismatch = "Error_ECIESError_DecryptedDataLengthMismatch",
|
|
40
|
+
Error_ECIESError_RecipientCountMismatch = "Error_ECIESError_RecipientCountMismatch",
|
|
41
|
+
Error_ECIESError_DataTooShortForMultiRecipientHeader = "Error_ECIESError_DataTooShortForMultiRecipientHeader",
|
|
42
|
+
Error_ECIESError_FailedToDecryptChallengeTemplate = "Error_ECIESError_FailedToDecryptChallengeTemplate",
|
|
43
|
+
Error_ECIESError_InvalidChallengeSignature = "Error_ECIESError_InvalidChallengeSignature",
|
|
44
|
+
Error_ECIESError_FailedToDervivePrivateKey = "Error_ECIESError_FailedToDervivePrivateKey",
|
|
45
|
+
Error_ECIESError_InvalidPublicKeyFormatOrLengthTemplate = "Error_ECIESError_InvalidPublicKeyFormatOrLengthTemplate",
|
|
46
|
+
Error_ECIESError_ReceivedNullOrUndefinedPublicKey = "Error_ECIESError_ReceivedNullOrUndefinedPublicKey",
|
|
47
|
+
Error_ECIESError_MessageLengthExceedsMaximumAllowedSizeTemplate = "Error_ECIESError_MessageLengthExceedsMaximumAllowedSizeTemplate",
|
|
48
|
+
Error_ECIESError_MultipleEncryptionTypeNotSupportedInSingleRecipientMode = "Error_ECIESError_MultipleEncryptionTypeNotSupportedInSingleRecipientMode",
|
|
49
|
+
Error_ECIESError_EncryptionTypeMismatchTemplate = "Error_ECIESError_EncryptionTypeMismatchTemplate",
|
|
50
|
+
Error_ECIESError_DataTooShortTemplate = "Error_ECIESError_DataTooShortTemplate",
|
|
51
|
+
Error_ECIESError_DataLengthMismatchTemplate = "Error_ECIESError_DataLengthMismatchTemplate",
|
|
52
|
+
Error_ECIESError_CombinedDataTooShortForComponents = "Error_ECIESError_CombinedDataTooShortForComponents",
|
|
31
53
|
Error_MemberError_MissingMemberName = "Error_MemberError_MissingMemberName",
|
|
32
54
|
Error_MemberError_InvalidMemberNameWhitespace = "Error_MemberError_InvalidMemberNameWhitespace",
|
|
33
55
|
Error_MemberError_InvalidEmail = "Error_MemberError_InvalidEmail",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ecies-string-key.d.ts","sourceRoot":"","sources":["../../src/enumerations/ecies-string-key.ts"],"names":[],"mappings":"AACA,oBAAY,cAAc;IACxB,qDAAqD,0DAA0D;IAC/G,4CAA4C,iDAAiD;IAC7F,uDAAuD,4DAA4D;IACnH,mDAAmD,wDAAwD;IAC3G,oDAAoD,yDAAyD;IAC7G,yBAAyB,8BAA8B;IACvD,sCAAsC,2CAA2C;IACjF,gCAAgC,qCAAqC;IACrE,qCAAqC,0CAA0C;IAC/E,oCAAoC,yCAAyC;IAC7E,kCAAkC,uCAAuC;IACzE,2CAA2C,gDAAgD;IAC3F,kCAAkC,uCAAuC;IACzE,gCAAgC,qCAAqC;IACrE,iCAAiC,sCAAsC;IACvE,sCAAsC,2CAA2C;IACjF,0CAA0C,+CAA+C;IACzF,0CAA0C,+CAA+C;IACzF,kCAAkC,uCAAuC;IACzE,iCAAiC,sCAAsC;IACvE,uCAAuC,4CAA4C;IACnF,kCAAkC,uCAAuC;IACzE,oCAAoC,yCAAyC;IAC7E,0CAA0C,+CAA+C;IACzF,sCAAsC,2CAA2C;IACjF,iCAAiC,sCAAsC;IACvE,iCAAiC,sCAAsC;IACvE,0CAA0C,+CAA+C;IACzF,wCAAwC,6CAA6C;
|
|
1
|
+
{"version":3,"file":"ecies-string-key.d.ts","sourceRoot":"","sources":["../../src/enumerations/ecies-string-key.ts"],"names":[],"mappings":"AACA,oBAAY,cAAc;IACxB,qDAAqD,0DAA0D;IAC/G,4CAA4C,iDAAiD;IAC7F,uDAAuD,4DAA4D;IACnH,mDAAmD,wDAAwD;IAC3G,oDAAoD,yDAAyD;IAC7G,yBAAyB,8BAA8B;IACvD,sCAAsC,2CAA2C;IACjF,8CAA8C,mDAAmD;IACjG,gCAAgC,qCAAqC;IACrE,qCAAqC,0CAA0C;IAC/E,oCAAoC,yCAAyC;IAC7E,kCAAkC,uCAAuC;IACzE,2CAA2C,gDAAgD;IAC3F,kCAAkC,uCAAuC;IACzE,gCAAgC,qCAAqC;IACrE,iCAAiC,sCAAsC;IACvE,sCAAsC,2CAA2C;IACjF,0CAA0C,+CAA+C;IACzF,0CAA0C,+CAA+C;IACzF,kCAAkC,uCAAuC;IACzE,iCAAiC,sCAAsC;IACvE,uCAAuC,4CAA4C;IACnF,kCAAkC,uCAAuC;IACzE,oCAAoC,yCAAyC;IAC7E,0CAA0C,+CAA+C;IACzF,sCAAsC,2CAA2C;IACjF,iCAAiC,sCAAsC;IACvE,iCAAiC,sCAAsC;IACvE,0CAA0C,+CAA+C;IACzF,wCAAwC,6CAA6C;IACrF,4DAA4D,iEAAiE;IAC7H,8DAA8D,mEAAmE;IACjI,4EAA4E,iFAAiF;IAC7J,kDAAkD,uDAAuD;IACzG,mCAAmC,wCAAwC;IAC3E,0CAA0C,+CAA+C;IACzF,wCAAwC,6CAA6C;IACrF,4CAA4C,iDAAiD;IAC7F,uCAAuC,4CAA4C;IACnF,oDAAoD,yDAAyD;IAC7G,iDAAiD,sDAAs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ultipleRecipientIdSize";
|
|
8
8
|
EciesStringKey["Error_ECIESError_CRCError"] = "Error_ECIESError_CRCError";
|
|
9
9
|
EciesStringKey["Error_ECIESError_InvalidEncryptionType"] = "Error_ECIESError_InvalidEncryptionType";
|
|
10
|
+
EciesStringKey["Error_ECIESError_InvalidEncryptionTypeTemplate"] = "Error_ECIESError_InvalidEncryptionTypeTemplate";
|
|
10
11
|
EciesStringKey["Error_ECIESError_InvalidIVLength"] = "Error_ECIESError_InvalidIVLength";
|
|
11
12
|
EciesStringKey["Error_ECIESError_InvalidAuthTagLength"] = "Error_ECIESError_InvalidAuthTagLength";
|
|
12
13
|
EciesStringKey["Error_ECIESError_InvalidHeaderLength"] = "Error_ECIESError_InvalidHeaderLength";
|
|
@@ -29,6 +30,27 @@ export var EciesStringKey;
|
|
|
29
30
|
EciesStringKey["Error_ECIESError_DecryptionFailed"] = "Error_ECIESError_DecryptionFailed";
|
|
30
31
|
EciesStringKey["Error_ECIESError_InvalidRecipientPublicKey"] = "Error_ECIESError_InvalidRecipientPublicKey";
|
|
31
32
|
EciesStringKey["Error_ECIESError_SecretComputationFailed"] = "Error_ECIESError_SecretComputationFailed";
|
|
33
|
+
EciesStringKey["Error_ECIESError_AuthenticationTagIsRequiredForKeyEncryption"] = "Error_ECIESError_AuthenticationTagIsRequiredForKeyEncryption";
|
|
34
|
+
EciesStringKey["Error_ECIESError_AuthenticationTagIsRequiredForECIESEncryption"] = "Error_ECIESError_AuthenticationTagIsRequiredForECIESEncryption";
|
|
35
|
+
EciesStringKey["Error_ECIESError_AuthenticationTagIsRequiredForMultiRecipientECIESEncryption"] = "Error_ECIESError_AuthenticationTagIsRequiredForMultiRecipientECIESEncryption";
|
|
36
|
+
EciesStringKey["Error_ECIESError_InvalidEncryptedKeyLengthTemplate"] = "Error_ECIESError_InvalidEncryptedKeyLengthTemplate";
|
|
37
|
+
EciesStringKey["Error_ECIESError_FailedToDecryptKey"] = "Error_ECIESError_FailedToDecryptKey";
|
|
38
|
+
EciesStringKey["Error_ECIESError_TooManyRecipientsTemplate"] = "Error_ECIESError_TooManyRecipientsTemplate";
|
|
39
|
+
EciesStringKey["Error_ECIESError_MessageTooLargeTemplate"] = "Error_ECIESError_MessageTooLargeTemplate";
|
|
40
|
+
EciesStringKey["Error_ECIESError_DecryptedDataLengthMismatch"] = "Error_ECIESError_DecryptedDataLengthMismatch";
|
|
41
|
+
EciesStringKey["Error_ECIESError_RecipientCountMismatch"] = "Error_ECIESError_RecipientCountMismatch";
|
|
42
|
+
EciesStringKey["Error_ECIESError_DataTooShortForMultiRecipientHeader"] = "Error_ECIESError_DataTooShortForMultiRecipientHeader";
|
|
43
|
+
EciesStringKey["Error_ECIESError_FailedToDecryptChallengeTemplate"] = "Error_ECIESError_FailedToDecryptChallengeTemplate";
|
|
44
|
+
EciesStringKey["Error_ECIESError_InvalidChallengeSignature"] = "Error_ECIESError_InvalidChallengeSignature";
|
|
45
|
+
EciesStringKey["Error_ECIESError_FailedToDervivePrivateKey"] = "Error_ECIESError_FailedToDervivePrivateKey";
|
|
46
|
+
EciesStringKey["Error_ECIESError_InvalidPublicKeyFormatOrLengthTemplate"] = "Error_ECIESError_InvalidPublicKeyFormatOrLengthTemplate";
|
|
47
|
+
EciesStringKey["Error_ECIESError_ReceivedNullOrUndefinedPublicKey"] = "Error_ECIESError_ReceivedNullOrUndefinedPublicKey";
|
|
48
|
+
EciesStringKey["Error_ECIESError_MessageLengthExceedsMaximumAllowedSizeTemplate"] = "Error_ECIESError_MessageLengthExceedsMaximumAllowedSizeTemplate";
|
|
49
|
+
EciesStringKey["Error_ECIESError_MultipleEncryptionTypeNotSupportedInSingleRecipientMode"] = "Error_ECIESError_MultipleEncryptionTypeNotSupportedInSingleRecipientMode";
|
|
50
|
+
EciesStringKey["Error_ECIESError_EncryptionTypeMismatchTemplate"] = "Error_ECIESError_EncryptionTypeMismatchTemplate";
|
|
51
|
+
EciesStringKey["Error_ECIESError_DataTooShortTemplate"] = "Error_ECIESError_DataTooShortTemplate";
|
|
52
|
+
EciesStringKey["Error_ECIESError_DataLengthMismatchTemplate"] = "Error_ECIESError_DataLengthMismatchTemplate";
|
|
53
|
+
EciesStringKey["Error_ECIESError_CombinedDataTooShortForComponents"] = "Error_ECIESError_CombinedDataTooShortForComponents";
|
|
32
54
|
// Member Error Types - buildReasonMap(MemberErrorType, 'Error', 'MemberError')
|
|
33
55
|
EciesStringKey["Error_MemberError_MissingMemberName"] = "Error_MemberError_MissingMemberName";
|
|
34
56
|
EciesStringKey["Error_MemberError_InvalidMemberNameWhitespace"] = "Error_MemberError_InvalidMemberNameWhitespace";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ecies-string-key.js","sourceRoot":"","sources":["../../src/enumerations/ecies-string-key.ts"],"names":[],"mappings":"AACA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"ecies-string-key.js","sourceRoot":"","sources":["../../src/enumerations/ecies-string-key.ts"],"names":[],"mappings":"AACA,MAAM,CAAN,IAAY,cAoGX;AApGD,WAAY,cAAc;IACxB,iIAA+G,CAAA;IAC/G,+GAA6F,CAAA;IAC7F,qIAAmH,CAAA;IACnH,6HAA2G,CAAA;IAC3G,+HAA6G,CAAA;IAC7G,yEAAuD,CAAA;IACvD,mGAAiF,CAAA;IACjF,mHAAiG,CAAA;IACjG,uFAAqE,CAAA;IACrE,iGAA+E,CAAA;IAC/E,+FAA6E,CAAA;IAC7E,2FAAyE,CAAA;IACzE,6GAA2F,CAAA;IAC3F,2FAAyE,CAAA;IACzE,uFAAqE,CAAA;IACrE,yFAAuE,CAAA;IACvE,mGAAiF,CAAA;IACjF,2GAAyF,CAAA;IACzF,2GAAyF,CAAA;IACzF,2FAAyE,CAAA;IACzE,yFAAuE,CAAA;IACvE,qGAAmF,CAAA;IACnF,2FAAyE,CAAA;IACzE,+FAA6E,CAAA;IAC7E,2GAAyF,CAAA;IACzF,mGAAiF,CAAA;IACjF,yFAAuE,CAAA;IACvE,yFAAuE,CA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AA;IACnH,+FAA6E,CAAA;IAE7E,qFAAmE,CAAA;IACnE,iGAA+E,CAAA;IAC/E,qHAAmG,CAAA;IACnG,mHAAiG,CAAA;AACnG,CAAC,EApGW,cAAc,KAAd,cAAc,QAoGzB"}
|
package/dist/i18n-setup.d.ts
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
import { PluginI18nEngine
|
|
1
|
+
import { PluginI18nEngine } from '@digitaldefiance/i18n-lib';
|
|
2
2
|
import { EciesStringKey } from './enumerations/ecies-string-key';
|
|
3
3
|
export declare const EciesI18nEngineKey: "DigitalDefiance.Ecies.I18nEngine";
|
|
4
4
|
export declare const EciesComponentId: "ecies";
|
|
5
|
-
export
|
|
5
|
+
export declare const EciesLanguageCodes: {
|
|
6
|
+
readonly EN_US: "en-US";
|
|
7
|
+
readonly EN_GB: "en-GB";
|
|
8
|
+
readonly FR: "fr";
|
|
9
|
+
readonly ES: "es";
|
|
10
|
+
readonly DE: "de";
|
|
11
|
+
readonly ZH_CN: "zh-CN";
|
|
12
|
+
readonly JA: "ja";
|
|
13
|
+
readonly UK: "uk";
|
|
14
|
+
};
|
|
15
|
+
export type EciesSupportedLanguageCode = typeof EciesLanguageCodes[keyof typeof EciesLanguageCodes];
|
|
6
16
|
export declare function initEciesI18nEngine(): PluginI18nEngine<EciesSupportedLanguageCode>;
|
|
7
17
|
export declare function getEciesI18nEngine(): PluginI18nEngine<EciesSupportedLanguageCode>;
|
|
8
18
|
export declare function resetEciesI18nForTests(): void;
|
package/dist/i18n-setup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n-setup.d.ts","sourceRoot":"","sources":["../src/i18n-setup.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"i18n-setup.d.ts","sourceRoot":"","sources":["../src/i18n-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gBAAgB,EAGjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,E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