pixel-react 1.15.81 → 1.15.82
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/components/StatusButton/StatusButton.js +1 -1
- package/lib/components/StatusButton/StatusButton.js.map +1 -1
- package/lib/components/Table/Table.js +7 -4
- package/lib/components/Table/Table.js.map +1 -1
- package/lib/components/Table/Types.d.ts +2 -0
- package/lib/components/Table/components/VirtualizedRows.d.ts +1 -1
- package/lib/components/Table/components/VirtualizedRows.js +3 -2
- package/lib/components/Table/components/VirtualizedRows.js.map +1 -1
- package/lib/components/TableTreeFn/Components/TableRow.js +1 -1
- package/lib/components/TableTreeFn/Components/TableRow.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +16 -8
- package/lib/index.js.map +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 +28 -16
- package/lib/utils/getEncryptedData/getEncryptedData.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getEncryptedData(data: string, base64PublicKey: string): Promise<string>;
|
|
1
|
+
export declare function getEncryptedData(data: string, base64PublicKey: string, requestProtocol?: string): Promise<string>;
|
|
@@ -1,18 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import JSEncrypt from 'jsencrypt';
|
|
2
|
+
export async function getEncryptedData(data, base64PublicKey, requestProtocol = 'https') {
|
|
3
|
+
if (requestProtocol === 'http') {
|
|
4
|
+
const encrypt = new JSEncrypt();
|
|
5
|
+
encrypt.setPublicKey(base64PublicKey);
|
|
6
|
+
const enData = encrypt.encrypt(data);
|
|
7
|
+
if (!enData) {
|
|
8
|
+
throw new Error('JSEncrypt failed: Encryption returned false (check key or data length).');
|
|
9
|
+
}
|
|
10
|
+
return enData;
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
// Decode the base64-encoded public key
|
|
14
|
+
const keyBytes = Uint8Array.from(atob(base64PublicKey), (c) => c.charCodeAt(0));
|
|
15
|
+
// Import the public key in SPKI format
|
|
16
|
+
const publicKey = await crypto.subtle.importKey('spki', keyBytes, {
|
|
17
|
+
name: 'RSA-OAEP',
|
|
18
|
+
hash: 'SHA-256',
|
|
19
|
+
}, false, ['encrypt']);
|
|
20
|
+
// Convert data to Uint8Array
|
|
21
|
+
const encodedData = new TextEncoder().encode(data);
|
|
22
|
+
// Encrypt the data using RSA-OAEP
|
|
23
|
+
const encryptedData = await crypto.subtle.encrypt({
|
|
24
|
+
name: 'RSA-OAEP',
|
|
25
|
+
}, publicKey, encodedData);
|
|
26
|
+
// Convert encrypted data to base64
|
|
27
|
+
return btoa(String.fromCharCode(...new Uint8Array(encryptedData)));
|
|
28
|
+
}
|
|
17
29
|
}
|
|
18
30
|
//# sourceMappingURL=getEncryptedData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEncryptedData.js","sourceRoot":"","sources":["../../../src/utils/getEncryptedData/getEncryptedData.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,gBAAgB,
|
|
1
|
+
{"version":3,"file":"getEncryptedData.js","sourceRoot":"","sources":["../../../src/utils/getEncryptedData/getEncryptedData.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,WAAW,CAAC;AAElC,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,IAAY,EACZ,eAAuB,EACvB,eAAe,GAAG,OAAO;IAEzB,IAAI,eAAe,KAAK,MAAM,EAAE,CAAC;QAC/B,MAAM,OAAO,GAAG,IAAI,SAAS,EAAE,CAAC;QAChC,OA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