use sign-magnatude not twos-complement in key parsing
parent
60bda31c54
commit
a6806255b8
|
@ -86,9 +86,9 @@ public class KeyFetcher {
|
||||||
|
|
||||||
if(algorithm.equals("RSA")){
|
if(algorithm.equals("RSA")){
|
||||||
byte[] modulusByte = Base64.decodeBase64(object.get("mod").getAsString());
|
byte[] modulusByte = Base64.decodeBase64(object.get("mod").getAsString());
|
||||||
BigInteger modulus = new BigInteger(modulusByte);
|
BigInteger modulus = new BigInteger(1, modulusByte);
|
||||||
byte[] exponentByte = Base64.decodeBase64(object.get("exp").getAsString());
|
byte[] exponentByte = Base64.decodeBase64(object.get("exp").getAsString());
|
||||||
BigInteger exponent = new BigInteger(exponentByte);
|
BigInteger exponent = new BigInteger(1, exponentByte);
|
||||||
|
|
||||||
RSAPublicKeySpec spec = new RSAPublicKeySpec(modulus, exponent);
|
RSAPublicKeySpec spec = new RSAPublicKeySpec(modulus, exponent);
|
||||||
KeyFactory factory = KeyFactory.getInstance("RSA");
|
KeyFactory factory = KeyFactory.getInstance("RSA");
|
||||||
|
|
Loading…
Reference in New Issue