I would suggest, at least as an initial change, using the other Verify method on DocumentSignatureInfo since it will return a VerificationStatus flag which you can use to get more information on exactly why the program thinks the signature is invalid, as opposed to this Verify method that just gives a boolean. You can use the other method like this:
SignutareVerificationOptions param = new SignutareVerificationOptions();
// Set your flags here
// Note that these flags can be combined with the & operator
param.VerificationFlags = SignatureVerificationFlags.None;
// If you want to check the timestamp validity, you have to set the time manually
if (param.HasFlag(SignatureVerificationFlags.CheckSignatureDateForExpiration))
param.VerificationTime = param.Timestamp.ToLocalTime();
VerificationStatus status = singleSig.Verify(param);
// This gets you a VerificationStatus that you can examine
if (status == VerificationStatus.Success)
{
// Verification successful
}
else
{
// Verification unsuccessful, use the VerificationStatus to determine why.
}
My suspicion is that once you try this you will get VerificationStatus.Invalid. If this is the case, it is probably because the Workflow service is running as a user that does not have access to the certificate. To verify, check:
if (singleSig.Certificate == null)
// Your user can't find the certificate
In that case, try running it as a standalone application using the same user as the client and your results should match.