How to generate public key from modulus and exponent in RSA in javascript JSEncrypt library
In my project we are encrypting the data using RSA.The client shared RSA modulus and exponent (65531 hard coded value).We have to generate the RSA public key using this two in front end by using JSEncrypt.
In the javacode we are generating like below.
BigInteger modulus = new BigInteger(mod);
BigInteger exponent = new BigInteger(exp);
RSAPublicKeySpec rsaPublicKeySpec = new RSAPublicKeySpec(modulus, exponent);
KeyFactory fact = KeyFactory.getInstance("RSA");
PublicKey publicKey = fact.generatePublic(rsaPublicKeySpec);
We have to do the same thing in front end using JSEncrypt.
Is JSEncrypt have the built in method to generate public key using modulus and exponent.
Any help will be greatly appreciated!!!