Hello,
I am currently trying to implement a protocol to exchange a secret
session key. I am trying to send a digest from the server to the client that
is encrypted with the Server's Private key, however, I cannot figure out how
to encrypt data with the server's private key.
When I do the following:
ByteQueue PrivKey
PrivKey.Put(objConfig.GetPrivateKey(), objConfig.GetPrivateKeyLength());
RSAES_OAEP_SHA_Encryptor privs(PrivKey);
Crypto++ throws a BER Decode error. I figured that this is because
RSAES_OAEP_SHA_Encryptor is defined as a RSAPublicKeyTemplate. I tried
playing around with my own typedef's to get a RSAPrivateKeyTemplate
Encryptor object to no avail.
What am I doing wrong? I can encrypt data with the public key and decrypt
with the private key fine.
Michael Davis