I tried to call DSAConvertSignatureFormat with the signature generated by the two following ways,
************
byte signature[0x40];
DSAConvertSignatureFormat(signature, sizeof(signature), DSA_DER,
(byte*)signatureDSA_DER.c_str(), signatureDSA_DER.size(), DSA_DER);
************
the BERDecodeErr was thrown.
What is the format of the signatures generated in the following format?
************
size_t siglen = signer.MaxSignatureLength();
string signatureDSA_DER(siglen, 0x00);
siglen = signer.SignMessage(prng, (const byte*)content.c_str(), content.size(), (byte*)&signatureDSA_DER[0]);
signatureDSA_DER.resize(siglen);
************
string signatureDSA_DER;
StringSource s(content, true /*pump all*/,
new SignerFilter(prng,
signer,
new StringSink(signatureDSA_DER)
) // SignerFilter
); // StringSource
************