[Botan-devel] Two questions

Jack Lloyd lloyd at randombit.net
Mon Jul 4 08:15:55 EDT 2005


On Mon, Jul 04, 2005 at 10:57:29AM +0200, Ruben Quintero Lores wrote:
> Hi!
>  
> Somebody have an example for digital signature using RSA keys??? 

It is essentially equivalent to the DSA signature examples. Sections 5.3 and
5.5 in the API doc cover it reasonably well. Untested example for signature
generation:

const byte message[] = { /* some bits */ };
RSA_PrivateKey mykey = /* generated or loaded */;
PK_Signer* signer = get_pk_signer(mykey, "EMSA4(SHA-1)");
signer->update(message, sizeof(message));
SecureVector<byte> sig = signer->signature();
delete signer;

> When a hash a passphrase with hash->process(passphrase) wich method can
> I use to restore the passprhase to original?? hash->update()???

You cannot restore the passphrase under any (reasonable) circumstances.

-Jack




More information about the botan-devel mailing list