react-native-security-suite 0.5.10 → 0.5.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 +2 -13
- package/android/src/main/java/com/securitysuite/Sslpinning.java +1 -1
- package/ios/SecuritySuite.xcodeproj/project.xcworkspace/contents.xcworkspacedata +3 -0
- package/ios/SecuritySuite.xcodeproj/project.xcworkspace/xcuserdata/Navabi.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/package.json +1 -1
- package/ios/SecuritySuite.xcodeproj/project.xcworkspace/xcuserdata/mohammadnavabi.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/SecuritySuite.xcodeproj/xcuserdata/mohammadnavabi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -6
- /package/ios/SecuritySuite.xcodeproj/xcuserdata/{mohammadnavabi.xcuserdatad → Navabi.xcuserdatad}/xcschemes/xcschememanagement.plist +0 -0
package/README.md
CHANGED
|
@@ -23,7 +23,6 @@ npm install react-native-security-suite
|
|
|
23
23
|
|
|
24
24
|
## Usage
|
|
25
25
|
|
|
26
|
-
\
|
|
27
26
|
1. Android Root or iOS Jailbreak devices detection example:
|
|
28
27
|
|
|
29
28
|
```js
|
|
@@ -37,7 +36,6 @@ console.log('Root/Jailbreak detection result: ', isRiskyDevice);
|
|
|
37
36
|
2. Text Encryption/Decryption example:
|
|
38
37
|
|
|
39
38
|
```js
|
|
40
|
-
//
|
|
41
39
|
const softEncrypted = await encrypt('STR_FOR_ENCRYPT');
|
|
42
40
|
console.log('Encrypted result: ', softEncrypted);
|
|
43
41
|
const softDecrypted = await decrypt('STR_FOR_DECRYPT');
|
|
@@ -67,7 +65,6 @@ import {
|
|
|
67
65
|
decrypt,
|
|
68
66
|
} from 'react-native-security-suite';
|
|
69
67
|
|
|
70
|
-
// Hard Encrypt/Decrypt with sharedKey
|
|
71
68
|
const publicKey = await getPublicKey();
|
|
72
69
|
console.log('Public key: ', publicKey);
|
|
73
70
|
/*
|
|
@@ -77,7 +74,6 @@ console.log('Public key: ', publicKey);
|
|
|
77
74
|
const sharedKey = await getSharedKey('SERVER_PUBLIC_KEY');
|
|
78
75
|
console.log('Shared key: ', sharedKey);
|
|
79
76
|
|
|
80
|
-
// 1. Hard Encrypt/Decrypt by sharedKey
|
|
81
77
|
const hardEncrypted = await encryptBySharedKey('STR_FOR_ENCRYPT');
|
|
82
78
|
console.log('Encrypted result: ', hardEncrypted);
|
|
83
79
|
const hardDecrypted = await decryptBySharedKey('STR_FOR_DECRYPT');
|
|
@@ -93,18 +89,11 @@ import { fetch } from 'react-native-security-suite';
|
|
|
93
89
|
const response = await fetch('URL', {
|
|
94
90
|
method: 'GET', // or any http methods
|
|
95
91
|
headers: {
|
|
96
|
-
/* your request header */
|
|
97
92
|
'Content-Type': 'application/json',
|
|
98
93
|
},
|
|
99
94
|
body: undefiend,
|
|
100
|
-
certificates: [
|
|
101
|
-
|
|
102
|
-
'sha256/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=',
|
|
103
|
-
],
|
|
104
|
-
validDomains: [
|
|
105
|
-
/* your valid domains */
|
|
106
|
-
'example.com',
|
|
107
|
-
],
|
|
95
|
+
certificates: ['sha256/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX='],
|
|
96
|
+
validDomains: ['example.com'],
|
|
108
97
|
timeout: 6000,
|
|
109
98
|
});
|
|
110
99
|
console.log('server response: ', response.json());
|
|
@@ -136,7 +136,7 @@ public class Sslpinning {
|
|
|
136
136
|
|
|
137
137
|
ReadableArray hashes = options.getArray("certificates");
|
|
138
138
|
for (int i = 0; i < hashes.size(); i++) {
|
|
139
|
-
certificatePinner.add(hostname, hashes.getString(i));
|
|
139
|
+
certificatePinner.add(hostname, "sha256/" + hashes.getString(i).replaceAll("sha256/", ""));
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
return certificatePinner.build();
|
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|