in IMDSSample.cs [70:89]
private static void ValidateAttestedData(AttestedDocument document)
{
try
{
byte[] blob = Convert.FromBase64String(document.Signature);
SignedCms signedCms = new SignedCms();
signedCms.Decode(blob);
string result = Encoding.UTF8.GetString(signedCms.ContentInfo.Content);
Console.WriteLine("Attested data: {0}", result);
AttestedData data = SerializeObjectFromJsonString(typeof(AttestedData), result) as AttestedData;
if (data.Nonce.Equals(NonceValue))
{
Console.WriteLine("Nonce values match");
}
}
catch (Exception ex)
{
Console.WriteLine("Error checking signature blob: '{0}'", ex);
}
}