The DSA signature generated by OpenSSL cannot be verified using .NET crypto API. The error message indicates the DSA signature length is not 40 bytes. The DSA signature generated by .NET crypto API cannot be verified using OpenSSL, either. The error has something to do with ASN.1 encoding routines. Obviously, both errors are due to the different encoding schemes used to encode the generated signature. From the error message, it seems that OpenSSL uses ASN.1 encoding. There is no mention in MSDN regarding to the DSA signature encoding scheme used in .NET crypto. Thank to the article by Jeffrey Walton --
Cryptographic Interoperability: Digital Signatures. .NET crypto uses P1363 to encode the DSA signature. Besides, the article also provides very useful AnsKeyBuilder and AsnKeyParser classes, which make the conversion from P1363 to ASN.1, and vise versa pretty trivial.
0 comments:
Post a Comment