Hey I want to implement RSA crypt in my server, but I have question, how can I write/load public key?
Like I want to send public key from server to client and then read those 128 bytes and set as key. Any clues?
Hey I want to implement RSA crypt in my server, but I have question, how can I write/load public key?
Like I want to send public key from server to client and then read those 128 bytes and set as key. Any clues?
It depends on the crypto library you're using.
If you're using OpenSSL, check out BN_bin2bn and BN_bn2bin. If you're using the Windows CryptoAPI, use CryptExportKey and CryptImportKey.
Well I found that I can use this method :
But it's encoded public key after save (160B), is there way to save decoded as normal?Code:publicKey.Save( StringSink(sPublicKey).Ref() );
Last edited by kargo; 04-11-2011 at 09:22 AM.
That's where the functions I mentioned come into play, although they are plain C functions, so they don't take a class as parameters.
EDIT: I just realized you're using a third party crypto library, so what I said before unfortunately doesn't help you much, unless you use a different library.
Last edited by Clairvoyant1332; 04-11-2011 at 11:20 AM.