I'm trying to encrypt a message using asymmetric private-public keys.
In Botan
, using Load_key()
functions, I read the private key and want to extract it's public key from it. For constructing of an RSA public key in it's constructor, I'll need a "Algorithm Identifier" object and "key bits" which I have. The algorithm identifier object using pcks8_algorithm_identifier()
function.
The problem is the "Key Bits" which returns a secure_vector<unsigned char>
instead of a vector<unsigned char>
and I encounter a bad::alloc exception
when I want to pass it to RSA_PublicKey constructor.
Does anyone encounter such problem? If there is an alternative way of asymmetric encryption by loading keys from an input file in Botan I'll appreciate that