I have this method, in doall.cpp
void RSASignFile(const char *privFilename, const char *messageFilename,
const char *signatureFilename)
{
AutoSeededRandomPool randPool = AutoSeededRandomPool();
unsigned int msgLength=512;
SecByteBlock msg(msgLength);
InvertibleRSAFunction privKey;
FileSource privFile(privFilename, true, new HexDecoder);
FileSource msgFile(messageFilename, true);
msgFile.Get(msg, msgLength);
RSASSA_PKCS1v15_SHA_Signer priv(privFile);
privKey = (InvertibleRSAFunction&)priv.GetPrivateKey();
if (privKey.Validate(randPool, 3)){
unsigned int sigLength = priv.SignatureLength();
printf("private key is acceptable with length of %i \n", sigLength);
SecByteBlock sig(sigLength);
priv.SignMessage(randPool, msg, msgLength, sig);
StringSource(sig, priv.SignatureLength(), true, new HexEncoder(new
FileSink(cout)));
}
}
When i call it using crypto++ 5.1 under redhat 9.0, i get the following
error:
% Abort
and the program exits, the program aborts on the line:
priv.SignMessage(randPool, msg, msgLength, sig).
please help
amerson