[Botan-devel] problems decoding BER

Muzaffar Mahkamov mahkamov at gmail.com
Thu Jan 25 09:30:25 EST 2007


Hi,

I'm having strange problems decoding RAW_BER encoded Private key.
Here's a demo code:

Botan::Pipe pipe;
pipe.start_msg();
Botan::PKCS8::encode(priv_key, pipe, Botan::RAW_BER);
pipe.end_msg();

Botan::SecureVector<byte> tmp = pipe.read_all();

Botan::DataSource_Memory ds(tmp);
auto_ptr<Botan::PKCS8_PrivateKey> pkcs8(Botan::PKCS8::load_key(ds));


PKCS8::load_key() fails decoding "BER" here. There's no problem using
PEM encoding. Even if I take "tmp" and encode it to PEM using
PEM_Code::encode the PKCS8::load_key() fails.

I'm using Botan 1.4.12

Thanks in advance,
Muzaffar




More information about the botan-devel mailing list