Hi all, 
I found that the default format is P1363.
Since I am signing the message using crypto++ ecdsa, and verify the 
signature with Go, I need to change the signature format from P1363 to DER.

I referred to the 
document 
https://www.codeproject.com/Articles/25590/Cryptographic-Interoperability-Digital-Signatures

However, the length below is 0, does anybody know if there is something 
wrong?
// Determine size of required buffer
auto length = DSAConvertSignatureFormat(NULL, 0, DSA_DER,
            (byte*)signatureP1363.c_str(), signatureP1363.size(), 
DSA_P1363);


王祥於 2018年7月18日星期三 UTC+8上午7時21分01秒寫道:
>
> Hi guys, 
>
>
> 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
> ************
>
> Best Regards,
>

-- 
You received this message because you are subscribed to "Crypto++ Users". More 
information about Crypto++ and this group is available at 
http://www.cryptopp.com and 
http://groups.google.com/forum/#!forum/cryptopp-users.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to