1

The following code fails when the user is logged on under a mandatory or temporary profile.

private static bool VerifySignature(byte[] signature, byte[] data) {    
     DSACryptoServiceProvider verifier = new DSACryptoServiceProvider();
     verifier.FromXmlString(publicKey);
     bool isValid = verifier.VerifyData(data, signature);
     return isValid;
}

where publicKey is an xml string containing elements for P, Q, G, Y, J, etc.

The failure occurs on the FromXmlString method and according to this article using P/Invoke should allow us to get around it. There is even a full blown code version by the same author that looks promising. The problem is that these are both for RSA encryption, and we are using DSA encryption.

Does anyone have any code that will successfully verify the signature of a byte array of data given a byte arry for signature and an xml public key?

axeman
  • 505
  • 1
  • 5
  • 18

0 Answers0