Skip to content

Commit a408efa

Browse files
authored
Merge pull request #26 from nsivraj/master
Fix SHA512 bug on Android and then added SHA512 if statement to iOS.
2 parents da2caa6 + 95a6a23 commit a408efa

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

android/src/main/java/com/pedrouid/crypto/RCTRsa.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ private String getAlgorithmFromHash(final String hash) {
3838
return "SHA256withRSA";
3939
} else if (hash.equals("SHA384")) {
4040
return "SHA384withRSA";
41+
} else if (hash.equals("SHA512")) {
42+
return "SHA512withRSA";
4143
} else {
42-
return "SHA1withRSA";
44+
return "SHA512withRSA";
4345
}
4446
}
4547

ios/RCTCrypto/RCTRsa.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ + (SecKeyAlgorithm)getAlgorithmFromHash:(NSString *)hash {
2323
return kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA256;
2424
} else if ([hash isEqualToString:@"SHA384"]) {
2525
return kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA384;
26+
} else if ([hash isEqualToString:@"SHA512"]) {
27+
return kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA512;
2628
} else {
2729
return kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA512;
2830
}

0 commit comments

Comments
 (0)