[Botan-devel] Question with loading multiple public keys from a
file
Eunsoo Roh
nes1209 at hotmail.com
Mon Apr 23 10:08:45 EDT 2007
> Date: Mon, 23 Apr 2007 10:04:15 -0400> From: lloyd at randombit.net> To: botan-devel at randombit.net> Subject: Re: [Botan-devel] Question with loading multiple public keys from a file> > On Mon, Apr 23, 2007 at 10:58:00PM +0900, Eunsoo Roh wrote:> > > I'm writing an application to encrypt some data with RSA> > algorithm. I have a PEM file, which contains bunch of sets of public> > keys for encryption. It was a piece of cake to load single key with> > Botan's well-formed interface, but I have no idea at all to load> > multiple keys from a single file. How can I acquire key object for> > each sets and iterate/or specifically load nth key from it?> > From a file, this is pretty easy, you want something like (untested,> may need tweaks):> > DataSource_Stream in("rsakeys.pem");> std::vector<X509_PublicKey*> keys;> while(!in.end_of_data())> {> X509_PublicKey* key = 0;> > try {> key = X509::load_key(in);> }> catch(Decoding_Error) { /* ignore (or maybe print what() */ }> > if(key)> keys.push_back(key);> }> > (and if you want specifically RSA keys you can dynamic_cast them)> > > BTW, even though application runs fine, it constantly prints warnings. Is this normal?> > Probably not - can you post an example?> > -J> _______________________________________________> botan-devel mailing list> botan-devel at randombit.net> http://www.randombit.net/mailman/listinfo/botan-devel
D:\Dev\Botan\include\botan\base.h(29) : warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)D:\Dev\Botan\include\botan\base.h(30) : warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)D:\Dev\Botan\include\botan\base.h(158) : warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)auth.cpp(72) : warning C4541: 'dynamic_cast' used on polymorphic type 'Botan::Public_Key' with /GR-; unpredictable behavior may resultD:\Dev\Botan\include\botan\base.h(29) : warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)D:\Dev\Botan\include\botan\base.h(30) : warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)D:\Dev\Botan\include\botan\base.h(158) : warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
Here are the build-time warnings. I guess they are related to compiler being too strict, but not sure.
_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.randombit.net/pipermail/botan-devel/attachments/20070423/b17a2467/attachment.htm
More information about the botan-devel
mailing list