wokier / gwt-crypto

Automatically exported from code.google.com/p/gwt-crypto
8 stars 1 forks source link

Cannot parse RSA public key from a base-64 string #30

Open jnazander opened 6 years ago

jnazander commented 6 years ago

If I have a base64-encoded public key sent from the server, I cannot parse it or do anything with it!

The reason being is that to create a new RSAKeyParameters object, it requires both the "modulus" and the "exponent" of the public key as constructor input parameters.

Is there any particular reason that it requires inputting the modulus and exponent separately? Why can't it just take the Base64 public key and create a RSAKeyParameters object with it, so it can be used for encrypting? To get around this issue, I would then need to send the modulus and exponent separately from the server, presumably concatenating it somehow.