Feb 28, 2009, 3:23:10 PM2/28/09
to Crypto++ Users
I've built the below code(RSASign) successfully and it works fine:
#include "osrng.h" // PRNG
#include "hex.h" // Hex Encoder/Decoder
#include "filters.h" // String Source and Sink
using namespace std;
using namespace CryptoPP;
string message = "Yoda said, Do or Do Not. There is not try.";
// Input: Private Key
// Output: Signed Message M
// Sign Away...
StringSource( message, true,
new SignerFilter( rng, priv,
) // HexEncoder
) // SignerFilter
); // StringSource
cout<<signature[i]<<" | ";
It's private key value is in a RSAPrivateKey structure format,as
defined by PKCS#1,
And is of type a DER-encoded PKCS#8 PrivateKeyInfo structure.
I need to sign a message by only "n"(modulus) and "d"(private
I've read "RSADumpKeys" example to parse key fields,but I don't know
how can I sign a message with only "n" and "d" parts?
And with which function?
I want to store "n" and "d" parts of generated Private key into a byte
array(with length 256 bytes) and sign a message with this array,
Is this job possible with the above "CryptoPP" functions? or their
input private key should be only in DER-encoded format?
Because now I need to store only 256 bytes(128 bytes for "n" and 128
bytes for "d")!
What is your suggesstion?
Hope you help me!
Thanks in Advance.