[Botan-devel] PKCS8

Alex Castillo acr_korn at yahoo.com
Fri Dec 19 10:00:39 EST 2008


I'm using wxDev-cpp on Windows XP. The library has been compiled with the last stable mingw, without the tr1 libraries.

I haven't catched any exception, I'll test it in that way and I'll give you the results.

Thanks.



--- El jue 18-dic-08, Jack Lloyd <lloyd at randombit.net> escribió:

> De:: Jack Lloyd <lloyd at randombit.net>
> Asunto: Re: [Botan-devel] PKCS8
> A: "Botan development list" <botan-devel at randombit.net>
> Fecha: jueves, 18 diciembre, 2008, 12:39 am
> On Mon, Dec 15, 2008 at 11:31:06AM -0800, Alex Castillo
> wrote:
> > Hello,
> >
> > I'm trying to open a PKCS8 DER encoded RSA key
> using:
> > PKCS8_PrivateKey* load_key(DataSource& in,
> RandomNumberGenerator& rng, std::string passphrase =
> "");
> >
> > but I cannot achieve it, I get an unexpected crash in
> the application.
> 
> Hi Alex,
> 
> Hrm, this works for me:
> 
> (motoko ~)$ cat rsa.cpp
> 
> #include <botan/botan.h>
> #include <botan/pkcs8.h>
> #include <iostream>
> 
> using namespace Botan;
> 
> int main()
>    {
>    LibraryInitializer init;
> 
>    DataSource_Stream
> in("aaa010101aaa_CSD_01.key");
>    std::string pass = "a0123456789";
> 
>    AutoSeeded_RNG rng;
> 
>    PKCS8_PrivateKey* key = PKCS8::load_key(in, rng, pass);
> 
>    std::cout << PKCS8::PEM_encode(*key);
>    }
> 
> (motoko ~)$ !g+
> g++ rsa.cpp -lbotan -o rsa
> (motoko ~)$ ./rsa
> -----BEGIN PRIVATE KEY-----
> MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAOmaJbWr2DLMIW0x
> xtoUMl7GTYikuhN01eDhOgZFn9/6EiOaPc3o4NZfUBE0UZihwQd/XXcalbk57+aP
> pSqEGmIfglFM1HhR1vybIlMCsiU4PKdUe4hS7KEqjuBsxsN1eOKVMBhjZdZC5Dto
> O1bCe1SY2Di8AL8Xc61HPf7L3AzlAgMBAAECgYB82Qeiaq9nprWOuHXAg97PzEgP
> 6YoRb/YG9Big1YE2oV4kbQDvFbFkoRgXudCKNJkHushnKWwvzIksvkTVzjiShz7b
> 5Lo4XqBxa6NwtHlQVEhmxzGjR7WujfTBJPIwFx0F5YBJtoTLv7swXjpbSECEETtv
> j0lSZ27PV8GO0016gQJBAPdVs0Cxt//3RXBlV7FRdY2q7A+wBmOZ2kvVN7VF0Lm3
> GPYRtR0M9ppgLVwJdeNuV/2uzLJWJSjCw21yeH3bBJECQQDxyUgc5sRKJlkSd22Z
> i5GWAuxfYav+qjfS4BS6sfunxDTtJY5kImQ48lSGHapqdhmyew5gdb70GvlTqAOS
> fF0VAkEAui5r2dYt0OOdBMd0pIjSOYshWYnCtXUaCx18atscDMCUbJ7VvAGHHJwr
> aO3CLSph2BeeBNyt6in6HEggBXU50QJBALu/utmGcGHLyVrHljmm4RQFjRq7s1z7
> PIHpMu+OCYZKm3aStTEYa460zeGe45frwSSQ3acVh4Px9i15x9xV6ckCQQDEz5DO
> hV0mnDX+KOH4h9nl42G8wrZuPgN77/ZLHkpln1KIjttFo6MF+9ojsCR4fQumKFRF
> bXZm3uFm/yQLTnwm
> -----END PRIVATE KEY-----
> 
> Also: are you catching exceptions? With some
> compilers/runtimes,
> an uncaught exception looks quite like a crash.
> 
> -Jack
> _______________________________________________
> botan-devel mailing list
> botan-devel at randombit.net
> http://lists.randombit.net/mailman/listinfo/botan-devel


      ¡Todo sobre Amor y Sexo!
La guía completa para tu vida en Mujer de Hoy.                       
http://mx.mujer.yahoo.com/



More information about the botan-devel mailing list