[botan-devel] store public key in aplication and use to verify signed file

Jack Lloyd lloyd at randombit.net
Tue Jan 10 10:32:51 EST 2012


On Tue, Jan 10, 2012 at 05:06:06PM +1100, Radiceski, Darko wrote:
> Dear all,
>  
> I was wondering if it is possible to store the public key in my
> application and then get:
>  
>       std::auto_ptr<X509_PublicKey> key(X509::load_key(argv[1])); 
>       DSA_PublicKey* dsakey = dynamic_cast<DSA_PublicKey*>(key.get());
>  
> to use the string value rather then reading from a file.

It's a bit verbose, but

  std::string my_key_string = ...
  DataSource_Memory src(my_key_string);
  std::auto_ptr<X509_PublicKey> key(X509::load_key(src));
  DSA_PublicKey* dsakey = dynamic_cast<DSA_PublicKey*>(key.get());




More information about the botan-devel mailing list