Java Digital Signature different to C#

后端 未结 2 770
醉梦人生
醉梦人生 2021-01-03 02:31

I have the following c# code to generate a digital signature from a private key:

    static string Sign(string text, string certificate)
    {

        X509C         


        
相关标签:
2条回答
  • 2021-01-03 03:09

    Ok so I have confirmed it. If I remove the MessageDigest/Hashing code from the java sample code then the two digital signatures are the same. Not sure why, but I'll try and find out. If anyone would like to educate me further feel free.

    0 讨论(0)
  • 2021-01-03 03:19

    The Java sign method does hashing and signing based on the algorithms provided in getInstance method of the Signature class, so basically you were hashing twice in Java.

    0 讨论(0)
提交回复
热议问题