Your message is enveloped with base64 encoding. As TElMessageVerifier class expects binary unencoded messages on input, please decode the data prior to passing it to the Verify() or VerifyDetached() method.

You can use .NET framework's native Convert.FromBase64String() method to decode the data.

A well-formed PKCS#7/CAdES message always starts with a 0x30 byte. If the first byte of your candidate message is not 0x30, you can be sure that it's not a valid PKCS#7 structure - and you may assume it's a base64-encoded message and try to decode it. But in the latter case you should be prepared that it might not be a valid base64-encoded message either, and be ready to handle a relevant exception thrown by Convert.FromBase64String() call.

We use cookies to help provide you with the best possible online experience. By using this site, you agree that we may store and access cookies on your device. You can find out more about and set your own preferences here.