I have the following c# code to generate a digital signature from a private key:
static string Sign(string text, string certificate)
{
X509C
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.
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.