James Vanns wrote:

Thanks for that Jim. So in that case I'm assuming that the 'Encryptor'
equivalent encodes the public key in X509 format when calling DEREncode
()? E.g.

RSAES_OAEP_SHA_Encryptor public_key (private_key);
HexEncoder public_key_file (
                new FileSink (p_pb_file_name.c_str ()));

public_key.DEREncode (public_key_file);
public_key_file.MessageEnd ();

This public_key_file now holds a hex-encoded X509 encoded public key? An
"object" that identifies itself as an RSA public key? Trying to open
this with JCE fails with a BER decode error :-(



I'm guessing, but earlier versions of Crypto++ didn't put the full wrapper around the key. If you are using a key that doesn't conform to the current specfication, you will either need to find a way to get the current version to take the key or generate a full wrapper for your existing key. This has come up before, so maybe a search of the archives would help.

--

Jim Starkey
Netfrastructure, Inc.
978 526-1376




Reply via email to