react-native-security-suite 0.6.2 → 0.6.4
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/android/src/main/java/com/securitysuite/JWSGenerator.java +0 -1
- package/android/src/main/java/com/securitysuite/SecuritySuiteModule.java +3 -6
- package/android/src/main/java/com/securitysuite/Sslpinning.java +2 -5
- package/ios/SecuritySuite.xcodeproj/project.xcworkspace/xcuserdata/m.navabifar.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/package.json +1 -1
- package/react-native-security-suite.podspec +1 -1
|
@@ -8,7 +8,6 @@ import javax.crypto.SecretKey;
|
|
|
8
8
|
import java.nio.charset.StandardCharsets;
|
|
9
9
|
import java.security.InvalidKeyException;
|
|
10
10
|
import java.security.NoSuchAlgorithmException;
|
|
11
|
-
import java.security.PrivateKey;
|
|
12
11
|
|
|
13
12
|
public class JWSGenerator {
|
|
14
13
|
public String jwsHeader(byte[] payload, String keyId, String requestId, SecretKey secretKey) {
|
|
@@ -10,6 +10,7 @@ import com.facebook.react.module.annotations.ReactModule;
|
|
|
10
10
|
|
|
11
11
|
import androidx.annotation.NonNull;
|
|
12
12
|
|
|
13
|
+
import android.annotation.SuppressLint;
|
|
13
14
|
import android.provider.Settings;
|
|
14
15
|
import android.util.Base64;
|
|
15
16
|
import android.util.Log;
|
|
@@ -34,8 +35,6 @@ import javax.crypto.NoSuchPaddingException;
|
|
|
34
35
|
import javax.crypto.SecretKey;
|
|
35
36
|
import javax.crypto.spec.GCMParameterSpec;
|
|
36
37
|
import javax.crypto.spec.SecretKeySpec;
|
|
37
|
-
import javax.crypto.Mac;
|
|
38
|
-
import javax.crypto.spec.SecretKeySpec;
|
|
39
38
|
|
|
40
39
|
import com.scottyab.rootbeer.RootBeer;
|
|
41
40
|
|
|
@@ -96,10 +95,7 @@ public class SecuritySuiteModule extends ReactContextBaseJavaModule {
|
|
|
96
95
|
@ReactMethod
|
|
97
96
|
public void getSharedKey(String serverPK, Promise promise) {
|
|
98
97
|
try {
|
|
99
|
-
X509EncodedKeySpec keySpec = new X509EncodedKeySpec(Base64.decode(serverPK.getBytes(), Base64.NO_WRAP)); // Change
|
|
100
|
-
// ASN1
|
|
101
|
-
// to
|
|
102
|
-
// publicKey
|
|
98
|
+
X509EncodedKeySpec keySpec = new X509EncodedKeySpec(Base64.decode(serverPK.getBytes(), Base64.NO_WRAP)); // Change ASN1 to publicKey
|
|
103
99
|
KeyFactory keyFactory = KeyFactory.getInstance("EC");
|
|
104
100
|
serverPublicKey = keyFactory.generatePublic(keySpec);
|
|
105
101
|
secretKey = agreeSecretKey(keyPair.getPrivate(), serverPublicKey, true);
|
|
@@ -192,6 +188,7 @@ public class SecuritySuiteModule extends ReactContextBaseJavaModule {
|
|
|
192
188
|
}
|
|
193
189
|
}
|
|
194
190
|
|
|
191
|
+
@SuppressLint("HardwareIds")
|
|
195
192
|
private String getAndroidId() {
|
|
196
193
|
return Settings.Secure.getString(context.getContentResolver(),
|
|
197
194
|
Settings.Secure.ANDROID_ID);
|
|
@@ -22,20 +22,17 @@ import com.moczul.ok2curl.CurlInterceptor;
|
|
|
22
22
|
import org.json.JSONException;
|
|
23
23
|
|
|
24
24
|
import java.io.BufferedOutputStream;
|
|
25
|
-
import java.io.ByteArrayInputStream;
|
|
26
|
-
import java.io.ByteArrayOutputStream;
|
|
27
25
|
import java.io.File;
|
|
28
26
|
import java.io.FileOutputStream;
|
|
29
27
|
import java.io.IOException;
|
|
30
28
|
import java.io.InputStream;
|
|
31
|
-
import java.io.ObjectOutputStream;
|
|
32
29
|
import java.io.OutputStream;
|
|
30
|
+
|
|
33
31
|
import java.net.SocketTimeoutException;
|
|
34
32
|
import java.net.URI;
|
|
35
33
|
import java.net.URISyntaxException;
|
|
36
|
-
|
|
34
|
+
|
|
37
35
|
import java.util.ArrayList;
|
|
38
|
-
import java.util.Arrays;
|
|
39
36
|
import java.util.HashMap;
|
|
40
37
|
import java.util.List;
|
|
41
38
|
import java.util.Map;
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.license = package["license"]
|
|
12
12
|
s.authors = package["author"]
|
|
13
13
|
|
|
14
|
-
s.platforms = { :ios => "
|
|
14
|
+
s.platforms = { :ios => "13.0" }
|
|
15
15
|
s.source = { :git => "https://github.com/mohamadnavabi/react-native-security-suite.git", :tag => "#{s.version}" }
|
|
16
16
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|