pixel-react 1.14.91 → 1.14.92
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/lib/assets/icons/lambda_icon.svg.js +1 -1
- package/lib/assets/icons/lambda_icon.svg.js.map +1 -1
- package/lib/components/SessionManager/SessionManager.js +28 -21
- package/lib/components/SessionManager/SessionManager.js.map +1 -1
- package/lib/components/SessionManager/types.d.ts +1 -0
- package/lib/components/Tooltip/Tooltip.js +19 -0
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/components/TruncatedTooltip/TruncatedTooltip.js +3 -0
- package/lib/components/TruncatedTooltip/TruncatedTooltip.js.map +1 -1
- package/lib/index.cjs +71 -5241
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/node_modules/js-beautify/js/src/css/beautifier.js +1 -1
- package/lib/node_modules/js-beautify/js/src/css/options.js +1 -1
- package/lib/node_modules/js-beautify/js/src/html/tokenizer.js +1 -1
- package/lib/node_modules/js-beautify/js/src/javascript/beautifier.js +1 -1
- package/lib/node_modules/js-beautify/js/src/javascript/options.js +1 -1
- package/lib/node_modules/js-beautify/js/src/javascript/tokenizer.js +1 -1
- package/lib/styles.css +1 -1
- package/lib/styles.css.map +1 -1
- package/lib/utils/getEncryptedData/getEncryptedData.d.ts +1 -1
- package/lib/utils/getEncryptedData/getEncryptedData.js +17 -8
- package/lib/utils/getEncryptedData/getEncryptedData.js.map +1 -1
- package/package.json +1 -2
- package/lib/node_modules/jsencrypt/lib/JSEncrypt.js +0 -189
- package/lib/node_modules/jsencrypt/lib/JSEncrypt.js.map +0 -1
- package/lib/node_modules/jsencrypt/lib/JSEncryptRSAKey.js +0 -323
- package/lib/node_modules/jsencrypt/lib/JSEncryptRSAKey.js.map +0 -1
- package/lib/node_modules/jsencrypt/lib/index.js +0 -6
- package/lib/node_modules/jsencrypt/lib/index.js.map +0 -1
- package/lib/node_modules/jsencrypt/lib/lib/asn1js/asn1.js +0 -570
- package/lib/node_modules/jsencrypt/lib/lib/asn1js/asn1.js.map +0 -1
- package/lib/node_modules/jsencrypt/lib/lib/asn1js/base64.js +0 -88
- package/lib/node_modules/jsencrypt/lib/lib/asn1js/base64.js.map +0 -1
- package/lib/node_modules/jsencrypt/lib/lib/asn1js/hex.js +0 -66
- package/lib/node_modules/jsencrypt/lib/lib/asn1js/hex.js.map +0 -1
- package/lib/node_modules/jsencrypt/lib/lib/asn1js/int10.js +0 -87
- package/lib/node_modules/jsencrypt/lib/lib/asn1js/int10.js.map +0 -1
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/base64.js +0 -65
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/base64.js.map +0 -1
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/jsbn.js +0 -1700
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/jsbn.js.map +0 -1
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/prng4.js +0 -48
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/prng4.js.map +0 -1
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/rng.js +0 -77
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/rng.js.map +0 -1
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/rsa.js +0 -371
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/rsa.js.map +0 -1
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/util.js +0 -61
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/util.js.map +0 -1
- package/lib/node_modules/jsencrypt/lib/lib/jsrsasign/asn1-1.0.js +0 -1547
- package/lib/node_modules/jsencrypt/lib/lib/jsrsasign/asn1-1.0.js.map +0 -1
- package/lib/node_modules/jsencrypt/lib/lib/jsrsasign/yahoo.js +0 -71
- package/lib/node_modules/jsencrypt/lib/lib/jsrsasign/yahoo.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
export declare
|
1
|
+
export declare function getEncryptedData(data: string, base64PublicKey: string): Promise<string>;
|
@@ -1,11 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
const
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
};
|
1
|
+
async function getEncryptedData(data, base64PublicKey) {
|
2
|
+
// Decode the base64-encoded public key
|
3
|
+
const keyBytes = Uint8Array.from(atob(base64PublicKey), c => c.charCodeAt(0));
|
4
|
+
// Import the public key in SPKI format
|
5
|
+
const publicKey = await crypto.subtle.importKey('spki', keyBytes, {
|
6
|
+
name: 'RSA-OAEP',
|
7
|
+
hash: 'SHA-256'
|
8
|
+
}, false, ['encrypt']);
|
9
|
+
// Convert data to Uint8Array
|
10
|
+
const encodedData = new TextEncoder().encode(data);
|
11
|
+
// Encrypt the data using RSA-OAEP
|
12
|
+
const encryptedData = await crypto.subtle.encrypt({
|
13
|
+
name: 'RSA-OAEP'
|
14
|
+
}, publicKey, encodedData);
|
15
|
+
// Convert encrypted data to base64
|
16
|
+
return btoa(String.fromCharCode(...new Uint8Array(encryptedData)));
|
17
|
+
}
|
9
18
|
|
10
19
|
export { getEncryptedData };
|
11
20
|
//# sourceMappingURL=getEncryptedData.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getEncryptedData.js","sources":["../../../src/utils/getEncryptedData/getEncryptedData.ts"],"sourcesContent":[null],"names":["getEncryptedData","data","publicKey","encrypt","
|
1
|
+
{"version":3,"file":"getEncryptedData.js","sources":["../../../src/utils/getEncryptedData/getEncryptedData.ts"],"sourcesContent":[null],"names":["getEncryptedData","data","base64PublicKey","keyBytes","Uint8Array","from","atob","c","charCodeAt","publicKey","crypto","subtle","importKey","name","hash","encodedData","TextEncoder","encode","encryptedData","encrypt","btoa","String","fromCharCode"],"mappings":"AAAO,eAAeA,gBAAgBA,CAACC,IAAY,EAAEC,eAAuB,EAAA;AAC1E;AACA,EAAA,MAAMC,QAAQ,GAAGC,UAAU,CAACC,IAAI,CAACC,IAAI,CAACJ,eAAe,CAAC,EAAEK,CAAC,IAAIA,CAAC,CAACC,UAAU,CAAC,CAAC,CAAC,CAAC;AAE7E;AACA,EAAA,MAAMC,SAAS,GAAG,MAAMC,MAAM,CAACC,MAAM,CAACC,SAAS,CAC7C,MAAM,EACNT,QAAQ,EACR;AACEU,IAAAA,IAAI,EAAE,UAAU;AAChBC,IAAAA,IAAI,EAAE;AACP,GAAA,EACD,KAAK,EACL,CAAC,SAAS,CAAC,CACZ;AAED;EACA,MAAMC,WAAW,GAAG,IAAIC,WAAW,EAAE,CAACC,MAAM,CAAChB,IAAI,CAAC;AAElD;EACA,MAAMiB,aAAa,GAAG,MAAMR,MAAM,CAACC,MAAM,CAACQ,OAAO,CAC/C;AACEN,IAAAA,IAAI,EAAE;AACP,GAAA,EACDJ,SAAS,EACTM,WAAW,CACZ;AAED;AACA,EAAA,OAAOK,IAAI,CAACC,MAAM,CAACC,YAAY,CAAC,GAAG,IAAIlB,UAAU,CAACc,aAAa,CAAC,CAAC,CAAC;AACpE;;;;"}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "pixel-react",
|
3
3
|
"description": "Great for pixel-perfect, design-focused components in React",
|
4
|
-
"version": "1.14.
|
4
|
+
"version": "1.14.92",
|
5
5
|
"main": "lib/index.cjs",
|
6
6
|
"module": "lib/index.js",
|
7
7
|
"types": "lib/index.d.ts",
|
@@ -80,7 +80,6 @@
|
|
80
80
|
"draft-js": "^0.11.7",
|
81
81
|
"janus-gateway": "^1.3.1",
|
82
82
|
"js-beautify": "^1.15.1",
|
83
|
-
"jsencrypt": "^3.3.2",
|
84
83
|
"monaco-editor": "^0.52.2",
|
85
84
|
"prop-types": "^15.6.2",
|
86
85
|
"react-archer": "^4.4.0",
|
@@ -1,189 +0,0 @@
|
|
1
|
-
import { b64tohex, hex2b64 } from './lib/jsbn/base64.js';
|
2
|
-
import { JSEncryptRSAKey } from './JSEncryptRSAKey.js';
|
3
|
-
|
4
|
-
var _a;
|
5
|
-
var version = typeof process !== 'undefined' ? (_a = process.env) === null || _a === void 0 ? void 0 : _a.npm_package_version : undefined;
|
6
|
-
/**
|
7
|
-
*
|
8
|
-
* @param {Object} [options = {}] - An object to customize JSEncrypt behaviour
|
9
|
-
* possible parameters are:
|
10
|
-
* - default_key_size {number} default: 1024 the key size in bit
|
11
|
-
* - default_public_exponent {string} default: '010001' the hexadecimal representation of the public exponent
|
12
|
-
* - log {boolean} default: false whether log warn/error or not
|
13
|
-
* @constructor
|
14
|
-
*/
|
15
|
-
var JSEncrypt = /** @class */function () {
|
16
|
-
function JSEncrypt(options) {
|
17
|
-
if (options === void 0) {
|
18
|
-
options = {};
|
19
|
-
}
|
20
|
-
options = options || {};
|
21
|
-
this.default_key_size = options.default_key_size ? parseInt(options.default_key_size, 10) : 1024;
|
22
|
-
this.default_public_exponent = options.default_public_exponent || "010001"; // 65537 default openssl public exponent for rsa key type
|
23
|
-
this.log = options.log || false;
|
24
|
-
// The private and public key.
|
25
|
-
this.key = null;
|
26
|
-
}
|
27
|
-
/**
|
28
|
-
* Method to set the rsa key parameter (one method is enough to set both the public
|
29
|
-
* and the private key, since the private key contains the public key paramenters)
|
30
|
-
* Log a warning if logs are enabled
|
31
|
-
* @param {Object|string} key the pem encoded string or an object (with or without header/footer)
|
32
|
-
* @public
|
33
|
-
*/
|
34
|
-
JSEncrypt.prototype.setKey = function (key) {
|
35
|
-
if (this.log && this.key) {
|
36
|
-
console.warn("A key was already set, overriding existing.");
|
37
|
-
}
|
38
|
-
this.key = new JSEncryptRSAKey(key);
|
39
|
-
};
|
40
|
-
/**
|
41
|
-
* Proxy method for setKey, for api compatibility
|
42
|
-
* @see setKey
|
43
|
-
* @public
|
44
|
-
*/
|
45
|
-
JSEncrypt.prototype.setPrivateKey = function (privkey) {
|
46
|
-
// Create the key.
|
47
|
-
this.setKey(privkey);
|
48
|
-
};
|
49
|
-
/**
|
50
|
-
* Proxy method for setKey, for api compatibility
|
51
|
-
* @see setKey
|
52
|
-
* @public
|
53
|
-
*/
|
54
|
-
JSEncrypt.prototype.setPublicKey = function (pubkey) {
|
55
|
-
// Sets the public key.
|
56
|
-
this.setKey(pubkey);
|
57
|
-
};
|
58
|
-
/**
|
59
|
-
* Proxy method for RSAKey object's decrypt, decrypt the string using the private
|
60
|
-
* components of the rsa key object. Note that if the object was not set will be created
|
61
|
-
* on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor
|
62
|
-
* @param {string} str base64 encoded crypted string to decrypt
|
63
|
-
* @return {string} the decrypted string
|
64
|
-
* @public
|
65
|
-
*/
|
66
|
-
JSEncrypt.prototype.decrypt = function (str) {
|
67
|
-
// Return the decrypted string.
|
68
|
-
try {
|
69
|
-
return this.getKey().decrypt(b64tohex(str));
|
70
|
-
} catch (ex) {
|
71
|
-
return false;
|
72
|
-
}
|
73
|
-
};
|
74
|
-
/**
|
75
|
-
* Proxy method for RSAKey object's encrypt, encrypt the string using the public
|
76
|
-
* components of the rsa key object. Note that if the object was not set will be created
|
77
|
-
* on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor
|
78
|
-
* @param {string} str the string to encrypt
|
79
|
-
* @return {string} the encrypted string encoded in base64
|
80
|
-
* @public
|
81
|
-
*/
|
82
|
-
JSEncrypt.prototype.encrypt = function (str) {
|
83
|
-
// Return the encrypted string.
|
84
|
-
try {
|
85
|
-
return hex2b64(this.getKey().encrypt(str));
|
86
|
-
} catch (ex) {
|
87
|
-
return false;
|
88
|
-
}
|
89
|
-
};
|
90
|
-
/**
|
91
|
-
* Proxy method for RSAKey object's sign.
|
92
|
-
* @param {string} str the string to sign
|
93
|
-
* @param {function} digestMethod hash method
|
94
|
-
* @param {string} digestName the name of the hash algorithm
|
95
|
-
* @return {string} the signature encoded in base64
|
96
|
-
* @public
|
97
|
-
*/
|
98
|
-
JSEncrypt.prototype.sign = function (str, digestMethod, digestName) {
|
99
|
-
// return the RSA signature of 'str' in 'hex' format.
|
100
|
-
try {
|
101
|
-
return hex2b64(this.getKey().sign(str, digestMethod, digestName));
|
102
|
-
} catch (ex) {
|
103
|
-
return false;
|
104
|
-
}
|
105
|
-
};
|
106
|
-
/**
|
107
|
-
* Proxy method for RSAKey object's verify.
|
108
|
-
* @param {string} str the string to verify
|
109
|
-
* @param {string} signature the signature encoded in base64 to compare the string to
|
110
|
-
* @param {function} digestMethod hash method
|
111
|
-
* @return {boolean} whether the data and signature match
|
112
|
-
* @public
|
113
|
-
*/
|
114
|
-
JSEncrypt.prototype.verify = function (str, signature, digestMethod) {
|
115
|
-
// Return the decrypted 'digest' of the signature.
|
116
|
-
try {
|
117
|
-
return this.getKey().verify(str, b64tohex(signature), digestMethod);
|
118
|
-
} catch (ex) {
|
119
|
-
return false;
|
120
|
-
}
|
121
|
-
};
|
122
|
-
/**
|
123
|
-
* Getter for the current JSEncryptRSAKey object. If it doesn't exists a new object
|
124
|
-
* will be created and returned
|
125
|
-
* @param {callback} [cb] the callback to be called if we want the key to be generated
|
126
|
-
* in an async fashion
|
127
|
-
* @returns {JSEncryptRSAKey} the JSEncryptRSAKey object
|
128
|
-
* @public
|
129
|
-
*/
|
130
|
-
JSEncrypt.prototype.getKey = function (cb) {
|
131
|
-
// Only create new if it does not exist.
|
132
|
-
if (!this.key) {
|
133
|
-
// Get a new private key.
|
134
|
-
this.key = new JSEncryptRSAKey();
|
135
|
-
if (cb && {}.toString.call(cb) === "[object Function]") {
|
136
|
-
this.key.generateAsync(this.default_key_size, this.default_public_exponent, cb);
|
137
|
-
return;
|
138
|
-
}
|
139
|
-
// Generate the key.
|
140
|
-
this.key.generate(this.default_key_size, this.default_public_exponent);
|
141
|
-
}
|
142
|
-
return this.key;
|
143
|
-
};
|
144
|
-
/**
|
145
|
-
* Returns the pem encoded representation of the private key
|
146
|
-
* If the key doesn't exists a new key will be created
|
147
|
-
* @returns {string} pem encoded representation of the private key WITH header and footer
|
148
|
-
* @public
|
149
|
-
*/
|
150
|
-
JSEncrypt.prototype.getPrivateKey = function () {
|
151
|
-
// Return the private representation of this key.
|
152
|
-
return this.getKey().getPrivateKey();
|
153
|
-
};
|
154
|
-
/**
|
155
|
-
* Returns the pem encoded representation of the private key
|
156
|
-
* If the key doesn't exists a new key will be created
|
157
|
-
* @returns {string} pem encoded representation of the private key WITHOUT header and footer
|
158
|
-
* @public
|
159
|
-
*/
|
160
|
-
JSEncrypt.prototype.getPrivateKeyB64 = function () {
|
161
|
-
// Return the private representation of this key.
|
162
|
-
return this.getKey().getPrivateBaseKeyB64();
|
163
|
-
};
|
164
|
-
/**
|
165
|
-
* Returns the pem encoded representation of the public key
|
166
|
-
* If the key doesn't exists a new key will be created
|
167
|
-
* @returns {string} pem encoded representation of the public key WITH header and footer
|
168
|
-
* @public
|
169
|
-
*/
|
170
|
-
JSEncrypt.prototype.getPublicKey = function () {
|
171
|
-
// Return the private representation of this key.
|
172
|
-
return this.getKey().getPublicKey();
|
173
|
-
};
|
174
|
-
/**
|
175
|
-
* Returns the pem encoded representation of the public key
|
176
|
-
* If the key doesn't exists a new key will be created
|
177
|
-
* @returns {string} pem encoded representation of the public key WITHOUT header and footer
|
178
|
-
* @public
|
179
|
-
*/
|
180
|
-
JSEncrypt.prototype.getPublicKeyB64 = function () {
|
181
|
-
// Return the private representation of this key.
|
182
|
-
return this.getKey().getPublicBaseKeyB64();
|
183
|
-
};
|
184
|
-
JSEncrypt.version = version;
|
185
|
-
return JSEncrypt;
|
186
|
-
}();
|
187
|
-
|
188
|
-
export { JSEncrypt };
|
189
|
-
//# sourceMappingURL=JSEncrypt.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"JSEncrypt.js","sources":["../../../../node_modules/jsencrypt/lib/JSEncrypt.js"],"sourcesContent":["var _a;\nimport { b64tohex, hex2b64 } from \"./lib/jsbn/base64\";\nimport { JSEncryptRSAKey } from \"./JSEncryptRSAKey\";\nvar version = typeof process !== 'undefined'\n ? (_a = process.env) === null || _a === void 0 ? void 0 : _a.npm_package_version\n : undefined;\n/**\n *\n * @param {Object} [options = {}] - An object to customize JSEncrypt behaviour\n * possible parameters are:\n * - default_key_size {number} default: 1024 the key size in bit\n * - default_public_exponent {string} default: '010001' the hexadecimal representation of the public exponent\n * - log {boolean} default: false whether log warn/error or not\n * @constructor\n */\nvar JSEncrypt = /** @class */ (function () {\n function JSEncrypt(options) {\n if (options === void 0) { options = {}; }\n options = options || {};\n this.default_key_size = options.default_key_size\n ? parseInt(options.default_key_size, 10)\n : 1024;\n this.default_public_exponent = options.default_public_exponent || \"010001\"; // 65537 default openssl public exponent for rsa key type\n this.log = options.log || false;\n // The private and public key.\n this.key = null;\n }\n /**\n * Method to set the rsa key parameter (one method is enough to set both the public\n * and the private key, since the private key contains the public key paramenters)\n * Log a warning if logs are enabled\n * @param {Object|string} key the pem encoded string or an object (with or without header/footer)\n * @public\n */\n JSEncrypt.prototype.setKey = function (key) {\n if (this.log && this.key) {\n console.warn(\"A key was already set, overriding existing.\");\n }\n this.key = new JSEncryptRSAKey(key);\n };\n /**\n * Proxy method for setKey, for api compatibility\n * @see setKey\n * @public\n */\n JSEncrypt.prototype.setPrivateKey = function (privkey) {\n // Create the key.\n this.setKey(privkey);\n };\n /**\n * Proxy method for setKey, for api compatibility\n * @see setKey\n * @public\n */\n JSEncrypt.prototype.setPublicKey = function (pubkey) {\n // Sets the public key.\n this.setKey(pubkey);\n };\n /**\n * Proxy method for RSAKey object's decrypt, decrypt the string using the private\n * components of the rsa key object. Note that if the object was not set will be created\n * on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor\n * @param {string} str base64 encoded crypted string to decrypt\n * @return {string} the decrypted string\n * @public\n */\n JSEncrypt.prototype.decrypt = function (str) {\n // Return the decrypted string.\n try {\n return this.getKey().decrypt(b64tohex(str));\n }\n catch (ex) {\n return false;\n }\n };\n /**\n * Proxy method for RSAKey object's encrypt, encrypt the string using the public\n * components of the rsa key object. Note that if the object was not set will be created\n * on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor\n * @param {string} str the string to encrypt\n * @return {string} the encrypted string encoded in base64\n * @public\n */\n JSEncrypt.prototype.encrypt = function (str) {\n // Return the encrypted string.\n try {\n return hex2b64(this.getKey().encrypt(str));\n }\n catch (ex) {\n return false;\n }\n };\n /**\n * Proxy method for RSAKey object's sign.\n * @param {string} str the string to sign\n * @param {function} digestMethod hash method\n * @param {string} digestName the name of the hash algorithm\n * @return {string} the signature encoded in base64\n * @public\n */\n JSEncrypt.prototype.sign = function (str, digestMethod, digestName) {\n // return the RSA signature of 'str' in 'hex' format.\n try {\n return hex2b64(this.getKey().sign(str, digestMethod, digestName));\n }\n catch (ex) {\n return false;\n }\n };\n /**\n * Proxy method for RSAKey object's verify.\n * @param {string} str the string to verify\n * @param {string} signature the signature encoded in base64 to compare the string to\n * @param {function} digestMethod hash method\n * @return {boolean} whether the data and signature match\n * @public\n */\n JSEncrypt.prototype.verify = function (str, signature, digestMethod) {\n // Return the decrypted 'digest' of the signature.\n try {\n return this.getKey().verify(str, b64tohex(signature), digestMethod);\n }\n catch (ex) {\n return false;\n }\n };\n /**\n * Getter for the current JSEncryptRSAKey object. If it doesn't exists a new object\n * will be created and returned\n * @param {callback} [cb] the callback to be called if we want the key to be generated\n * in an async fashion\n * @returns {JSEncryptRSAKey} the JSEncryptRSAKey object\n * @public\n */\n JSEncrypt.prototype.getKey = function (cb) {\n // Only create new if it does not exist.\n if (!this.key) {\n // Get a new private key.\n this.key = new JSEncryptRSAKey();\n if (cb && {}.toString.call(cb) === \"[object Function]\") {\n this.key.generateAsync(this.default_key_size, this.default_public_exponent, cb);\n return;\n }\n // Generate the key.\n this.key.generate(this.default_key_size, this.default_public_exponent);\n }\n return this.key;\n };\n /**\n * Returns the pem encoded representation of the private key\n * If the key doesn't exists a new key will be created\n * @returns {string} pem encoded representation of the private key WITH header and footer\n * @public\n */\n JSEncrypt.prototype.getPrivateKey = function () {\n // Return the private representation of this key.\n return this.getKey().getPrivateKey();\n };\n /**\n * Returns the pem encoded representation of the private key\n * If the key doesn't exists a new key will be created\n * @returns {string} pem encoded representation of the private key WITHOUT header and footer\n * @public\n */\n JSEncrypt.prototype.getPrivateKeyB64 = function () {\n // Return the private representation of this key.\n return this.getKey().getPrivateBaseKeyB64();\n };\n /**\n * Returns the pem encoded representation of the public key\n * If the key doesn't exists a new key will be created\n * @returns {string} pem encoded representation of the public key WITH header and footer\n * @public\n */\n JSEncrypt.prototype.getPublicKey = function () {\n // Return the private representation of this key.\n return this.getKey().getPublicKey();\n };\n /**\n * Returns the pem encoded representation of the public key\n * If the key doesn't exists a new key will be created\n * @returns {string} pem encoded representation of the public key WITHOUT header and footer\n * @public\n */\n JSEncrypt.prototype.getPublicKeyB64 = function () {\n // Return the private representation of this key.\n return this.getKey().getPublicBaseKeyB64();\n };\n JSEncrypt.version = version;\n return JSEncrypt;\n}());\nexport { JSEncrypt };\n"],"names":["_a","version","process","env","npm_package_version","undefined","JSEncrypt","options","default_key_size","parseInt","default_public_exponent","log","key","prototype","setKey","console","warn","JSEncryptRSAKey","setPrivateKey","privkey","setPublicKey","pubkey","decrypt","str","getKey","b64tohex","ex","encrypt","hex2b64","sign","digestMethod","digestName","verify","signature","cb","toString","call","generateAsync","generate","getPrivateKey","getPrivateKeyB64","getPrivateBaseKeyB64","getPublicKey","getPublicKeyB64","getPublicBaseKeyB64"],"mappings":";;;AAAA,IAAIA,EAAE;AAGN,IAAIC,OAAO,GAAG,OAAOC,OAAO,KAAK,WAAW,GACtC,CAACF,EAAE,GAAGE,OAAO,CAACC,GAAG,MAAM,IAAI,IAAIH,EAAE,KAAK,MAAM,GAAG,MAAM,GAAGA,EAAE,CAACI,mBAAmB,GAC9EC,SAAS;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,SAAS,gBAAkB,YAAY;EACvC,SAASA,SAASA,CAACC,OAAO,EAAE;AACxB,IAAA,IAAIA,OAAO,KAAK,MAAM,EAAE;MAAEA,OAAO,GAAG,EAAE;AAAE;AACxCA,IAAAA,OAAO,GAAGA,OAAO,IAAI,EAAE;AACvB,IAAA,IAAI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AACpD,QAAA,IAAI,CAACtB,GAAG,CAACyB,aAAa,CAAC,IAAI,CAAC7B,gBAAgB,EAAE,IAAI,CAACE,uBAAuB,EAAEwB,EAAE,CAAC;AAC/E,QAAA;AACJ;AACA;AACA,MAAA,IAAI,CAACtB,GAAG,CAAC0B,QAAQ,CAAC,IAAI,CAAC9B,gBAAgB,EAAE,IAAI,CAACE,uBAAuB,CAAC;AAC1E;IACA,OAAO,IAAI,CAACE,GAAG;GAClB;AACD;AACJ;AACA;AACA;AACA;AACA;AACIN,EAAAA,SAAS,CAACO,SAAS,CAAC0B,aAAa,GAAG,YAAY;AAC5C;IACA,OAAO,IAAI,CAACf,MAAM,EAAE,CAACe,aAAa,EAAE;GACvC;AACD;AACJ;AACA;AACA;AACA;AACA;AACIjC,EAAAA,SAAS,CAACO,SAAS,CAAC2B,gBAAgB,GAAG,YAAY;AAC/C;IACA,OAAO,IAAI,CAAChB,MAAM,EAAE,CAACiB,oBAAoB,EAAE;GAC9C;AACD;AACJ;AACA;AACA;AACA;AACA;AACInC,EAAAA,SAAS,CAACO,SAAS,CAAC6B,YAAY,GAAG,YAAY;AAC3C;IACA,OAAO,IAAI,CAAClB,MAAM,EAAE,CAACkB,YAAY,EAAE;GACtC;AACD;AACJ;AACA;AACA;AACA;AACA;AACIpC,EAAAA,SAAS,CAACO,SAAS,CAAC8B,eAAe,GAAG,YAAY;AAC9C;IACA,OAAO,IAAI,CAACnB,MAAM,EAAE,CAACoB,mBAAmB,EAAE;GAC7C;EACDtC,SAAS,CAACL,OAAO,GAAGA,OAAO;AAC3B,EAAA,OAAOK,SAAS;AACpB,CAAC;;;;","x_google_ignoreList":[0]}
|
@@ -1,323 +0,0 @@
|
|
1
|
-
import { hex2b64 } from './lib/jsbn/base64.js';
|
2
|
-
import { Hex } from './lib/asn1js/hex.js';
|
3
|
-
import { Base64 } from './lib/asn1js/base64.js';
|
4
|
-
import { ASN1 } from './lib/asn1js/asn1.js';
|
5
|
-
import { RSAKey } from './lib/jsbn/rsa.js';
|
6
|
-
import { parseBigInt } from './lib/jsbn/jsbn.js';
|
7
|
-
import { KJUR } from './lib/jsrsasign/asn1-1.0.js';
|
8
|
-
|
9
|
-
var __extends = window && window.__extends || function () {
|
10
|
-
var extendStatics = function (d, b) {
|
11
|
-
extendStatics = Object.setPrototypeOf || {
|
12
|
-
__proto__: []
|
13
|
-
} instanceof Array && function (d, b) {
|
14
|
-
d.__proto__ = b;
|
15
|
-
} || function (d, b) {
|
16
|
-
for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
17
|
-
};
|
18
|
-
return extendStatics(d, b);
|
19
|
-
};
|
20
|
-
return function (d, b) {
|
21
|
-
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
22
|
-
extendStatics(d, b);
|
23
|
-
function __() {
|
24
|
-
this.constructor = d;
|
25
|
-
}
|
26
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
27
|
-
};
|
28
|
-
}();
|
29
|
-
/**
|
30
|
-
* Create a new JSEncryptRSAKey that extends Tom Wu's RSA key object.
|
31
|
-
* This object is just a decorator for parsing the key parameter
|
32
|
-
* @param {string|Object} key - The key in string format, or an object containing
|
33
|
-
* the parameters needed to build a RSAKey object.
|
34
|
-
* @constructor
|
35
|
-
*/
|
36
|
-
var JSEncryptRSAKey = /** @class */function (_super) {
|
37
|
-
__extends(JSEncryptRSAKey, _super);
|
38
|
-
function JSEncryptRSAKey(key) {
|
39
|
-
var _this = _super.call(this) || this;
|
40
|
-
// Call the super constructor.
|
41
|
-
// RSAKey.call(this);
|
42
|
-
// If a key key was provided.
|
43
|
-
if (key) {
|
44
|
-
// If this is a string...
|
45
|
-
if (typeof key === "string") {
|
46
|
-
_this.parseKey(key);
|
47
|
-
} else if (JSEncryptRSAKey.hasPrivateKeyProperty(key) || JSEncryptRSAKey.hasPublicKeyProperty(key)) {
|
48
|
-
// Set the values for the key.
|
49
|
-
_this.parsePropertiesFrom(key);
|
50
|
-
}
|
51
|
-
}
|
52
|
-
return _this;
|
53
|
-
}
|
54
|
-
/**
|
55
|
-
* Method to parse a pem encoded string containing both a public or private key.
|
56
|
-
* The method will translate the pem encoded string in a der encoded string and
|
57
|
-
* will parse private key and public key parameters. This method accepts public key
|
58
|
-
* in the rsaencryption pkcs #1 format (oid: 1.2.840.113549.1.1.1).
|
59
|
-
*
|
60
|
-
* @todo Check how many rsa formats use the same format of pkcs #1.
|
61
|
-
*
|
62
|
-
* The format is defined as:
|
63
|
-
* PublicKeyInfo ::= SEQUENCE {
|
64
|
-
* algorithm AlgorithmIdentifier,
|
65
|
-
* PublicKey BIT STRING
|
66
|
-
* }
|
67
|
-
* Where AlgorithmIdentifier is:
|
68
|
-
* AlgorithmIdentifier ::= SEQUENCE {
|
69
|
-
* algorithm OBJECT IDENTIFIER, the OID of the enc algorithm
|
70
|
-
* parameters ANY DEFINED BY algorithm OPTIONAL (NULL for PKCS #1)
|
71
|
-
* }
|
72
|
-
* and PublicKey is a SEQUENCE encapsulated in a BIT STRING
|
73
|
-
* RSAPublicKey ::= SEQUENCE {
|
74
|
-
* modulus INTEGER, -- n
|
75
|
-
* publicExponent INTEGER -- e
|
76
|
-
* }
|
77
|
-
* it's possible to examine the structure of the keys obtained from openssl using
|
78
|
-
* an asn.1 dumper as the one used here to parse the components: http://lapo.it/asn1js/
|
79
|
-
* @argument {string} pem the pem encoded string, can include the BEGIN/END header/footer
|
80
|
-
* @private
|
81
|
-
*/
|
82
|
-
JSEncryptRSAKey.prototype.parseKey = function (pem) {
|
83
|
-
try {
|
84
|
-
var modulus = 0;
|
85
|
-
var public_exponent = 0;
|
86
|
-
var reHex = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/;
|
87
|
-
var der = reHex.test(pem) ? Hex.decode(pem) : Base64.unarmor(pem);
|
88
|
-
var asn1 = ASN1.decode(der);
|
89
|
-
// Fixes a bug with OpenSSL 1.0+ private keys
|
90
|
-
if (asn1.sub.length === 3) {
|
91
|
-
asn1 = asn1.sub[2].sub[0];
|
92
|
-
}
|
93
|
-
if (asn1.sub.length === 9) {
|
94
|
-
// Parse the private key.
|
95
|
-
modulus = asn1.sub[1].getHexStringValue(); // bigint
|
96
|
-
this.n = parseBigInt(modulus, 16);
|
97
|
-
public_exponent = asn1.sub[2].getHexStringValue(); // int
|
98
|
-
this.e = parseInt(public_exponent, 16);
|
99
|
-
var private_exponent = asn1.sub[3].getHexStringValue(); // bigint
|
100
|
-
this.d = parseBigInt(private_exponent, 16);
|
101
|
-
var prime1 = asn1.sub[4].getHexStringValue(); // bigint
|
102
|
-
this.p = parseBigInt(prime1, 16);
|
103
|
-
var prime2 = asn1.sub[5].getHexStringValue(); // bigint
|
104
|
-
this.q = parseBigInt(prime2, 16);
|
105
|
-
var exponent1 = asn1.sub[6].getHexStringValue(); // bigint
|
106
|
-
this.dmp1 = parseBigInt(exponent1, 16);
|
107
|
-
var exponent2 = asn1.sub[7].getHexStringValue(); // bigint
|
108
|
-
this.dmq1 = parseBigInt(exponent2, 16);
|
109
|
-
var coefficient = asn1.sub[8].getHexStringValue(); // bigint
|
110
|
-
this.coeff = parseBigInt(coefficient, 16);
|
111
|
-
} else if (asn1.sub.length === 2) {
|
112
|
-
if (asn1.sub[0].sub) {
|
113
|
-
// Parse ASN.1 SubjectPublicKeyInfo type as defined by X.509
|
114
|
-
var bit_string = asn1.sub[1];
|
115
|
-
var sequence = bit_string.sub[0];
|
116
|
-
modulus = sequence.sub[0].getHexStringValue();
|
117
|
-
this.n = parseBigInt(modulus, 16);
|
118
|
-
public_exponent = sequence.sub[1].getHexStringValue();
|
119
|
-
this.e = parseInt(public_exponent, 16);
|
120
|
-
} else {
|
121
|
-
// Parse ASN.1 RSAPublicKey type as defined by PKCS #1
|
122
|
-
modulus = asn1.sub[0].getHexStringValue();
|
123
|
-
this.n = parseBigInt(modulus, 16);
|
124
|
-
public_exponent = asn1.sub[1].getHexStringValue();
|
125
|
-
this.e = parseInt(public_exponent, 16);
|
126
|
-
}
|
127
|
-
} else {
|
128
|
-
return false;
|
129
|
-
}
|
130
|
-
return true;
|
131
|
-
} catch (ex) {
|
132
|
-
return false;
|
133
|
-
}
|
134
|
-
};
|
135
|
-
/**
|
136
|
-
* Translate rsa parameters in a hex encoded string representing the rsa key.
|
137
|
-
*
|
138
|
-
* The translation follow the ASN.1 notation :
|
139
|
-
* RSAPrivateKey ::= SEQUENCE {
|
140
|
-
* version Version,
|
141
|
-
* modulus INTEGER, -- n
|
142
|
-
* publicExponent INTEGER, -- e
|
143
|
-
* privateExponent INTEGER, -- d
|
144
|
-
* prime1 INTEGER, -- p
|
145
|
-
* prime2 INTEGER, -- q
|
146
|
-
* exponent1 INTEGER, -- d mod (p1)
|
147
|
-
* exponent2 INTEGER, -- d mod (q-1)
|
148
|
-
* coefficient INTEGER, -- (inverse of q) mod p
|
149
|
-
* }
|
150
|
-
* @returns {string} DER Encoded String representing the rsa private key
|
151
|
-
* @private
|
152
|
-
*/
|
153
|
-
JSEncryptRSAKey.prototype.getPrivateBaseKey = function () {
|
154
|
-
var options = {
|
155
|
-
array: [new KJUR.asn1.DERInteger({
|
156
|
-
int: 0
|
157
|
-
}), new KJUR.asn1.DERInteger({
|
158
|
-
bigint: this.n
|
159
|
-
}), new KJUR.asn1.DERInteger({
|
160
|
-
int: this.e
|
161
|
-
}), new KJUR.asn1.DERInteger({
|
162
|
-
bigint: this.d
|
163
|
-
}), new KJUR.asn1.DERInteger({
|
164
|
-
bigint: this.p
|
165
|
-
}), new KJUR.asn1.DERInteger({
|
166
|
-
bigint: this.q
|
167
|
-
}), new KJUR.asn1.DERInteger({
|
168
|
-
bigint: this.dmp1
|
169
|
-
}), new KJUR.asn1.DERInteger({
|
170
|
-
bigint: this.dmq1
|
171
|
-
}), new KJUR.asn1.DERInteger({
|
172
|
-
bigint: this.coeff
|
173
|
-
})]
|
174
|
-
};
|
175
|
-
var seq = new KJUR.asn1.DERSequence(options);
|
176
|
-
return seq.getEncodedHex();
|
177
|
-
};
|
178
|
-
/**
|
179
|
-
* base64 (pem) encoded version of the DER encoded representation
|
180
|
-
* @returns {string} pem encoded representation without header and footer
|
181
|
-
* @public
|
182
|
-
*/
|
183
|
-
JSEncryptRSAKey.prototype.getPrivateBaseKeyB64 = function () {
|
184
|
-
return hex2b64(this.getPrivateBaseKey());
|
185
|
-
};
|
186
|
-
/**
|
187
|
-
* Translate rsa parameters in a hex encoded string representing the rsa public key.
|
188
|
-
* The representation follow the ASN.1 notation :
|
189
|
-
* PublicKeyInfo ::= SEQUENCE {
|
190
|
-
* algorithm AlgorithmIdentifier,
|
191
|
-
* PublicKey BIT STRING
|
192
|
-
* }
|
193
|
-
* Where AlgorithmIdentifier is:
|
194
|
-
* AlgorithmIdentifier ::= SEQUENCE {
|
195
|
-
* algorithm OBJECT IDENTIFIER, the OID of the enc algorithm
|
196
|
-
* parameters ANY DEFINED BY algorithm OPTIONAL (NULL for PKCS #1)
|
197
|
-
* }
|
198
|
-
* and PublicKey is a SEQUENCE encapsulated in a BIT STRING
|
199
|
-
* RSAPublicKey ::= SEQUENCE {
|
200
|
-
* modulus INTEGER, -- n
|
201
|
-
* publicExponent INTEGER -- e
|
202
|
-
* }
|
203
|
-
* @returns {string} DER Encoded String representing the rsa public key
|
204
|
-
* @private
|
205
|
-
*/
|
206
|
-
JSEncryptRSAKey.prototype.getPublicBaseKey = function () {
|
207
|
-
var first_sequence = new KJUR.asn1.DERSequence({
|
208
|
-
array: [new KJUR.asn1.DERObjectIdentifier({
|
209
|
-
oid: "1.2.840.113549.1.1.1"
|
210
|
-
}), new KJUR.asn1.DERNull()]
|
211
|
-
});
|
212
|
-
var second_sequence = new KJUR.asn1.DERSequence({
|
213
|
-
array: [new KJUR.asn1.DERInteger({
|
214
|
-
bigint: this.n
|
215
|
-
}), new KJUR.asn1.DERInteger({
|
216
|
-
int: this.e
|
217
|
-
})]
|
218
|
-
});
|
219
|
-
var bit_string = new KJUR.asn1.DERBitString({
|
220
|
-
hex: "00" + second_sequence.getEncodedHex()
|
221
|
-
});
|
222
|
-
var seq = new KJUR.asn1.DERSequence({
|
223
|
-
array: [first_sequence, bit_string]
|
224
|
-
});
|
225
|
-
return seq.getEncodedHex();
|
226
|
-
};
|
227
|
-
/**
|
228
|
-
* base64 (pem) encoded version of the DER encoded representation
|
229
|
-
* @returns {string} pem encoded representation without header and footer
|
230
|
-
* @public
|
231
|
-
*/
|
232
|
-
JSEncryptRSAKey.prototype.getPublicBaseKeyB64 = function () {
|
233
|
-
return hex2b64(this.getPublicBaseKey());
|
234
|
-
};
|
235
|
-
/**
|
236
|
-
* wrap the string in block of width chars. The default value for rsa keys is 64
|
237
|
-
* characters.
|
238
|
-
* @param {string} str the pem encoded string without header and footer
|
239
|
-
* @param {Number} [width=64] - the length the string has to be wrapped at
|
240
|
-
* @returns {string}
|
241
|
-
* @private
|
242
|
-
*/
|
243
|
-
JSEncryptRSAKey.wordwrap = function (str, width) {
|
244
|
-
width = width || 64;
|
245
|
-
if (!str) {
|
246
|
-
return str;
|
247
|
-
}
|
248
|
-
var regex = "(.{1," + width + "})( +|$\n?)|(.{1," + width + "})";
|
249
|
-
return str.match(RegExp(regex, "g")).join("\n");
|
250
|
-
};
|
251
|
-
/**
|
252
|
-
* Retrieve the pem encoded private key
|
253
|
-
* @returns {string} the pem encoded private key with header/footer
|
254
|
-
* @public
|
255
|
-
*/
|
256
|
-
JSEncryptRSAKey.prototype.getPrivateKey = function () {
|
257
|
-
var key = "-----BEGIN RSA PRIVATE KEY-----\n";
|
258
|
-
key += JSEncryptRSAKey.wordwrap(this.getPrivateBaseKeyB64()) + "\n";
|
259
|
-
key += "-----END RSA PRIVATE KEY-----";
|
260
|
-
return key;
|
261
|
-
};
|
262
|
-
/**
|
263
|
-
* Retrieve the pem encoded public key
|
264
|
-
* @returns {string} the pem encoded public key with header/footer
|
265
|
-
* @public
|
266
|
-
*/
|
267
|
-
JSEncryptRSAKey.prototype.getPublicKey = function () {
|
268
|
-
var key = "-----BEGIN PUBLIC KEY-----\n";
|
269
|
-
key += JSEncryptRSAKey.wordwrap(this.getPublicBaseKeyB64()) + "\n";
|
270
|
-
key += "-----END PUBLIC KEY-----";
|
271
|
-
return key;
|
272
|
-
};
|
273
|
-
/**
|
274
|
-
* Check if the object contains the necessary parameters to populate the rsa modulus
|
275
|
-
* and public exponent parameters.
|
276
|
-
* @param {Object} [obj={}] - An object that may contain the two public key
|
277
|
-
* parameters
|
278
|
-
* @returns {boolean} true if the object contains both the modulus and the public exponent
|
279
|
-
* properties (n and e)
|
280
|
-
* @todo check for types of n and e. N should be a parseable bigInt object, E should
|
281
|
-
* be a parseable integer number
|
282
|
-
* @private
|
283
|
-
*/
|
284
|
-
JSEncryptRSAKey.hasPublicKeyProperty = function (obj) {
|
285
|
-
obj = obj || {};
|
286
|
-
return obj.hasOwnProperty("n") && obj.hasOwnProperty("e");
|
287
|
-
};
|
288
|
-
/**
|
289
|
-
* Check if the object contains ALL the parameters of an RSA key.
|
290
|
-
* @param {Object} [obj={}] - An object that may contain nine rsa key
|
291
|
-
* parameters
|
292
|
-
* @returns {boolean} true if the object contains all the parameters needed
|
293
|
-
* @todo check for types of the parameters all the parameters but the public exponent
|
294
|
-
* should be parseable bigint objects, the public exponent should be a parseable integer number
|
295
|
-
* @private
|
296
|
-
*/
|
297
|
-
JSEncryptRSAKey.hasPrivateKeyProperty = function (obj) {
|
298
|
-
obj = obj || {};
|
299
|
-
return obj.hasOwnProperty("n") && obj.hasOwnProperty("e") && obj.hasOwnProperty("d") && obj.hasOwnProperty("p") && obj.hasOwnProperty("q") && obj.hasOwnProperty("dmp1") && obj.hasOwnProperty("dmq1") && obj.hasOwnProperty("coeff");
|
300
|
-
};
|
301
|
-
/**
|
302
|
-
* Parse the properties of obj in the current rsa object. Obj should AT LEAST
|
303
|
-
* include the modulus and public exponent (n, e) parameters.
|
304
|
-
* @param {Object} obj - the object containing rsa parameters
|
305
|
-
* @private
|
306
|
-
*/
|
307
|
-
JSEncryptRSAKey.prototype.parsePropertiesFrom = function (obj) {
|
308
|
-
this.n = obj.n;
|
309
|
-
this.e = obj.e;
|
310
|
-
if (obj.hasOwnProperty("d")) {
|
311
|
-
this.d = obj.d;
|
312
|
-
this.p = obj.p;
|
313
|
-
this.q = obj.q;
|
314
|
-
this.dmp1 = obj.dmp1;
|
315
|
-
this.dmq1 = obj.dmq1;
|
316
|
-
this.coeff = obj.coeff;
|
317
|
-
}
|
318
|
-
};
|
319
|
-
return JSEncryptRSAKey;
|
320
|
-
}(RSAKey);
|
321
|
-
|
322
|
-
export { JSEncryptRSAKey };
|
323
|
-
//# sourceMappingURL=JSEncryptRSAKey.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"JSEncryptRSAKey.js","sources":["../../../../node_modules/jsencrypt/lib/JSEncryptRSAKey.js"],"sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { hex2b64 } from \"./lib/jsbn/base64\";\nimport { Hex } from \"./lib/asn1js/hex\";\nimport { Base64 } from \"./lib/asn1js/base64\";\nimport { ASN1 } from \"./lib/asn1js/asn1\";\nimport { RSAKey } from \"./lib/jsbn/rsa\";\nimport { parseBigInt } from \"./lib/jsbn/jsbn\";\nimport { KJUR } from \"./lib/jsrsasign/asn1-1.0\";\n/**\n * Create a new JSEncryptRSAKey that extends Tom Wu's RSA key object.\n * This object is just a decorator for parsing the key parameter\n * @param {string|Object} key - The key in string format, or an object containing\n * the parameters needed to build a RSAKey object.\n * @constructor\n */\nvar JSEncryptRSAKey = /** @class */ (function (_super) {\n __extends(JSEncryptRSAKey, _super);\n function JSEncryptRSAKey(key) {\n var _this = _super.call(this) || this;\n // Call the super constructor.\n // RSAKey.call(this);\n // If a key key was provided.\n if (key) {\n // If this is a string...\n if (typeof key === \"string\") {\n _this.parseKey(key);\n }\n else if (JSEncryptRSAKey.hasPrivateKeyProperty(key) ||\n JSEncryptRSAKey.hasPublicKeyProperty(key)) {\n // Set the values for the key.\n _this.parsePropertiesFrom(key);\n }\n }\n return _this;\n }\n /**\n * Method to parse a pem encoded string containing both a public or private key.\n * The method will translate the pem encoded string in a der encoded string and\n * will parse private key and public key parameters. This method accepts public key\n * in the rsaencryption pkcs #1 format (oid: 1.2.840.113549.1.1.1).\n *\n * @todo Check how many rsa formats use the same format of pkcs #1.\n *\n * The format is defined as:\n * PublicKeyInfo ::= SEQUENCE {\n * algorithm AlgorithmIdentifier,\n * PublicKey BIT STRING\n * }\n * Where AlgorithmIdentifier is:\n * AlgorithmIdentifier ::= SEQUENCE {\n * algorithm OBJECT IDENTIFIER, the OID of the enc algorithm\n * parameters ANY DEFINED BY algorithm OPTIONAL (NULL for PKCS #1)\n * }\n * and PublicKey is a SEQUENCE encapsulated in a BIT STRING\n * RSAPublicKey ::= SEQUENCE {\n * modulus INTEGER, -- n\n * publicExponent INTEGER -- e\n * }\n * it's possible to examine the structure of the keys obtained from openssl using\n * an asn.1 dumper as the one used here to parse the components: http://lapo.it/asn1js/\n * @argument {string} pem the pem encoded string, can include the BEGIN/END header/footer\n * @private\n */\n JSEncryptRSAKey.prototype.parseKey = function (pem) {\n try {\n var modulus = 0;\n var public_exponent = 0;\n var reHex = /^\\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\\s*)+$/;\n var der = reHex.test(pem) ? Hex.decode(pem) : Base64.unarmor(pem);\n var asn1 = ASN1.decode(der);\n // Fixes a bug with OpenSSL 1.0+ private keys\n if (asn1.sub.length === 3) {\n asn1 = asn1.sub[2].sub[0];\n }\n if (asn1.sub.length === 9) {\n // Parse the private key.\n modulus = asn1.sub[1].getHexStringValue(); // bigint\n this.n = parseBigInt(modulus, 16);\n public_exponent = asn1.sub[2].getHexStringValue(); // int\n this.e = parseInt(public_exponent, 16);\n var private_exponent = asn1.sub[3].getHexStringValue(); // bigint\n this.d = parseBigInt(private_exponent, 16);\n var prime1 = asn1.sub[4].getHexStringValue(); // bigint\n this.p = parseBigInt(prime1, 16);\n var prime2 = asn1.sub[5].getHexStringValue(); // bigint\n this.q = parseBigInt(prime2, 16);\n var exponent1 = asn1.sub[6].getHexStringValue(); // bigint\n this.dmp1 = parseBigInt(exponent1, 16);\n var exponent2 = asn1.sub[7].getHexStringValue(); // bigint\n this.dmq1 = parseBigInt(exponent2, 16);\n var coefficient = asn1.sub[8].getHexStringValue(); // bigint\n this.coeff = parseBigInt(coefficient, 16);\n }\n else if (asn1.sub.length === 2) {\n if (asn1.sub[0].sub) {\n // Parse ASN.1 SubjectPublicKeyInfo type as defined by X.509\n var bit_string = asn1.sub[1];\n var sequence = bit_string.sub[0];\n modulus = sequence.sub[0].getHexStringValue();\n this.n = parseBigInt(modulus, 16);\n public_exponent = sequence.sub[1].getHexStringValue();\n this.e = parseInt(public_exponent, 16);\n }\n else {\n // Parse ASN.1 RSAPublicKey type as defined by PKCS #1\n modulus = asn1.sub[0].getHexStringValue();\n this.n = parseBigInt(modulus, 16);\n public_exponent = asn1.sub[1].getHexStringValue();\n this.e = parseInt(public_exponent, 16);\n }\n }\n else {\n return false;\n }\n return true;\n }\n catch (ex) {\n return false;\n }\n };\n /**\n * Translate rsa parameters in a hex encoded string representing the rsa key.\n *\n * The translation follow the ASN.1 notation :\n * RSAPrivateKey ::= SEQUENCE {\n * version Version,\n * modulus INTEGER, -- n\n * publicExponent INTEGER, -- e\n * privateExponent INTEGER, -- d\n * prime1 INTEGER, -- p\n * prime2 INTEGER, -- q\n * exponent1 INTEGER, -- d mod (p1)\n * exponent2 INTEGER, -- d mod (q-1)\n * coefficient INTEGER, -- (inverse of q) mod p\n * }\n * @returns {string} DER Encoded String representing the rsa private key\n * @private\n */\n JSEncryptRSAKey.prototype.getPrivateBaseKey = function () {\n var options = {\n array: [\n new KJUR.asn1.DERInteger({ int: 0 }),\n new KJUR.asn1.DERInteger({ bigint: this.n }),\n new KJUR.asn1.DERInteger({ int: this.e }),\n new KJUR.asn1.DERInteger({ bigint: this.d }),\n new KJUR.asn1.DERInteger({ bigint: this.p }),\n new KJUR.asn1.DERInteger({ bigint: this.q }),\n new KJUR.asn1.DERInteger({ bigint: this.dmp1 }),\n new KJUR.asn1.DERInteger({ bigint: this.dmq1 }),\n new KJUR.asn1.DERInteger({ bigint: this.coeff }),\n ],\n };\n var seq = new KJUR.asn1.DERSequence(options);\n return seq.getEncodedHex();\n };\n /**\n * base64 (pem) encoded version of the DER encoded representation\n * @returns {string} pem encoded representation without header and footer\n * @public\n */\n JSEncryptRSAKey.prototype.getPrivateBaseKeyB64 = function () {\n return hex2b64(this.getPrivateBaseKey());\n };\n /**\n * Translate rsa parameters in a hex encoded string representing the rsa public key.\n * The representation follow the ASN.1 notation :\n * PublicKeyInfo ::= SEQUENCE {\n * algorithm AlgorithmIdentifier,\n * PublicKey BIT STRING\n * }\n * Where AlgorithmIdentifier is:\n * AlgorithmIdentifier ::= SEQUENCE {\n * algorithm OBJECT IDENTIFIER, the OID of the enc algorithm\n * parameters ANY DEFINED BY algorithm OPTIONAL (NULL for PKCS #1)\n * }\n * and PublicKey is a SEQUENCE encapsulated in a BIT STRING\n * RSAPublicKey ::= SEQUENCE {\n * modulus INTEGER, -- n\n * publicExponent INTEGER -- e\n * }\n * @returns {string} DER Encoded String representing the rsa public key\n * @private\n */\n JSEncryptRSAKey.prototype.getPublicBaseKey = function () {\n var first_sequence = new KJUR.asn1.DERSequence({\n array: [\n new KJUR.asn1.DERObjectIdentifier({ oid: \"1.2.840.113549.1.1.1\" }),\n new KJUR.asn1.DERNull(),\n ],\n });\n var second_sequence = new KJUR.asn1.DERSequence({\n array: [\n new KJUR.asn1.DERInteger({ bigint: this.n }),\n new KJUR.asn1.DERInteger({ int: this.e }),\n ],\n });\n var bit_string = new KJUR.asn1.DERBitString({\n hex: \"00\" + second_sequence.getEncodedHex(),\n });\n var seq = new KJUR.asn1.DERSequence({\n array: [first_sequence, bit_string],\n });\n return seq.getEncodedHex();\n };\n /**\n * base64 (pem) encoded version of the DER encoded representation\n * @returns {string} pem encoded representation without header and footer\n * @public\n */\n JSEncryptRSAKey.prototype.getPublicBaseKeyB64 = function () {\n return hex2b64(this.getPublicBaseKey());\n };\n /**\n * wrap the string in block of width chars. The default value for rsa keys is 64\n * characters.\n * @param {string} str the pem encoded string without header and footer\n * @param {Number} [width=64] - the length the string has to be wrapped at\n * @returns {string}\n * @private\n */\n JSEncryptRSAKey.wordwrap = function (str, width) {\n width = width || 64;\n if (!str) {\n return str;\n }\n var regex = \"(.{1,\" + width + \"})( +|$\\n?)|(.{1,\" + width + \"})\";\n return str.match(RegExp(regex, \"g\")).join(\"\\n\");\n };\n /**\n * Retrieve the pem encoded private key\n * @returns {string} the pem encoded private key with header/footer\n * @public\n */\n JSEncryptRSAKey.prototype.getPrivateKey = function () {\n var key = \"-----BEGIN RSA PRIVATE KEY-----\\n\";\n key += JSEncryptRSAKey.wordwrap(this.getPrivateBaseKeyB64()) + \"\\n\";\n key += \"-----END RSA PRIVATE KEY-----\";\n return key;\n };\n /**\n * Retrieve the pem encoded public key\n * @returns {string} the pem encoded public key with header/footer\n * @public\n */\n JSEncryptRSAKey.prototype.getPublicKey = function () {\n var key = \"-----BEGIN PUBLIC KEY-----\\n\";\n key += JSEncryptRSAKey.wordwrap(this.getPublicBaseKeyB64()) + \"\\n\";\n key += \"-----END PUBLIC KEY-----\";\n return key;\n };\n /**\n * Check if the object contains the necessary parameters to populate the rsa modulus\n * and public exponent parameters.\n * @param {Object} [obj={}] - An object that may contain the two public key\n * parameters\n * @returns {boolean} true if the object contains both the modulus and the public exponent\n * properties (n and e)\n * @todo check for types of n and e. N should be a parseable bigInt object, E should\n * be a parseable integer number\n * @private\n */\n JSEncryptRSAKey.hasPublicKeyProperty = function (obj) {\n obj = obj || {};\n return obj.hasOwnProperty(\"n\") && obj.hasOwnProperty(\"e\");\n };\n /**\n * Check if the object contains ALL the parameters of an RSA key.\n * @param {Object} [obj={}] - An object that may contain nine rsa key\n * parameters\n * @returns {boolean} true if the object contains all the parameters needed\n * @todo check for types of the parameters all the parameters but the public exponent\n * should be parseable bigint objects, the public exponent should be a parseable integer number\n * @private\n */\n JSEncryptRSAKey.hasPrivateKeyProperty = function (obj) {\n obj = obj || {};\n return (obj.hasOwnProperty(\"n\") &&\n obj.hasOwnProperty(\"e\") &&\n obj.hasOwnProperty(\"d\") &&\n obj.hasOwnProperty(\"p\") &&\n obj.hasOwnProperty(\"q\") &&\n obj.hasOwnProperty(\"dmp1\") &&\n obj.hasOwnProperty(\"dmq1\") &&\n obj.hasOwnProperty(\"coeff\"));\n };\n /**\n * Parse the properties of obj in the current rsa object. Obj should AT LEAST\n * include the modulus and public exponent (n, e) parameters.\n * @param {Object} obj - the object containing rsa parameters\n * @private\n */\n JSEncryptRSAKey.prototype.parsePropertiesFrom = function (obj) {\n this.n = obj.n;\n this.e = obj.e;\n if (obj.hasOwnProperty(\"d\")) {\n this.d = obj.d;\n this.p = obj.p;\n this.q = obj.q;\n this.dmp1 = obj.dmp1;\n this.dmq1 = obj.dmq1;\n this.coeff = obj.coeff;\n }\n };\n return JSEncryptRSAKey;\n}(RSAKey));\nexport { JSEncryptRSAKey };\n"],"names":["__extends","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","JSEncryptRSAKey","_super","key","_this","parseKey","hasPrivateKeyProperty","hasPublicKeyProperty","parsePropertiesFrom","pem","modulus","public_exponent","reHex","der","test","Hex","decode","Base64","unarmor","asn1","ASN1","sub","length","getHexStringValue","n","parseBigInt","e","parseInt","private_exponent","prime1","prime2","q","exponent1","dmp1","exponent2","dmq1","coefficient","coeff","bit_string","sequence","ex","getPrivateBaseKey","options","array","KJUR","DERInteger","int","bigint","seq","DERSequence","getEncodedHex","getPrivateBaseKeyB64","hex2b64","getPublicBaseKey","first_sequence","DERObjectIdentifier","oid","DERNull","second_sequence","DERBitString","hex","getPublicBaseKeyB64","wordwrap","str","width","regex","match","RegExp","join","getPrivateKey","getPublicKey","obj","RSAKey"],"mappings":";;;;;;;;AAAA,IAAIA,SAAS,GAAIC,MAAI,IAAIA,MAAI,CAACD,SAAS,IAAM,YAAY;AACrD,EAAA,IAAIE,aAAa,GAAG,UAAUC,CAAC,EAAEC,CAAC,EAAE;AAChCF,IAAAA,aAAa,GAAGG,MAAM,CAACC,cAAc,IAChC;AAAEC,MAAAA,SAAS,EAAE;AAAG,KAAC,YAAYC,KAAK,IAAI,UAAUL,CAAC,EAAEC,CAAC,EAAE;MAAED,CAAC,CAACI,SAAS,GAAGH,CAAC;AAAE,KAAE,IAC5E,UAAUD,CAAC,EAAEC,CAAC,EAAE;MAAE,KAAK,IAAIK,CAAC,IAAIL,CAAC,EAAE,IAAIC,MAAM,CAACK,SAAS,CAACC,cAAc,CAACC,IAAI,CAACR,CAAC,EAAEK,CAAC,CAAC,EAAEN,CAAC,CAACM,CAAC,CAAC,GAAGL,CAAC,CAACK,CAAC,CAAC;KAAG;AACrG,IAAA,OAAOP,aAAa,CAACC,CAAC,EAAEC,CAAC,CAAC;GAC7B;AACD,EAAA,OAAO,UAAUD,CAAC,EAAEC,CAAC,EAAE;IACnB,IAAI,OAAOA,CAAC,KAAK,UAAU,IAAIA,CAAC,KAAK,IAAI,EACrC,MAAM,IAAIS,SAAS,CAAC,sBAAsB,GAAGC,MAAM,CAACV,CAAC,CAAC,GAAG,+BAA+B,CAAC;AAC7FF,IAAAA,aAAa,CAACC,CAAC,EAAEC,CAAC,CAAC;IACnB,SAASW,EAAEA,GAAG;MAAE,IAAI,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