Can i use RSAKey Class with regular server generated RSAKeys?
Like:
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6yFeJ/hedg4JzDmVlQOyw4YPadu90lN5YTrH/
2vdtobMOFTBA+f9gtvnIYONQIG22fJVrvHBnx2x/G+ho4k1kk2A3vbDxe/FwjjPe6/id9ahu0M61
VxighjOgwmtFo0EI7bjSfbaeVl7Cr97p++LRMeCVQoz3Ew5fHaKMQVUBuwIDAQAB
-----END PUBLIC KEY-----
it seems the class needs two big numbers, how can those numbers be generated?
Is the RSA compatible with anything outside juce?, or is more RSA-likeish.
The keys in the certificate files are stored in ASN1 format (or DSR), and there is nothing juce to read them.
You should either use OpenSSL/GnuPG to decode them first in plain numbers (typically in base 16 (hexadecimal), but beware of endianness), so you can use them in your code.
If you need crypto for something more important than sparse cyphering/decyphering, then you should use a crypto library instead (like OpenSSL, Crypto++, Botan, libtomcrypt, etc…), since the implementation of RSA in Juce was not made for speed, nor interoperability, so you’ll face harder and harder issues when you’ll have to work with other’s crypto system.
thanks guys i resigned to use juce for the server side stuff also with a small command line app, but i am having problem applying the key to a regular string.
This small app already generates the keys, write them to a json file, and recovers from them, to apply them to value, it’s allmost complete should be able to encode the contents of a file and write it to an output file.
But… i can’t apply them to a regular juce string…
Jakob,  your code was very useful, do you have an example for using the modulus from a private key to sign data as well ? I know i'm a year late to this thread, sorry ;)Â
Hey Onqel, I am glad that the code was useful for you. On the JUCE side we're only decrypting, so I am sorry that I cannot provide an example of encrypting.