in imdssample.java [79:98]
private static void ValidateAttestedData(byte[] decoded)
{
try
{
CMSSignedData signature = new CMSSignedData(decoded);
CMSTypedData signedData = signature.getSignedContent();
String signedDataString = new String((byte[])signedData.getContent());
System.out.println("Attested data: " + signedDataString);
AttestedData data = new Gson().fromJson(signedDataString, AttestedData.class);
if(data.nonce.compareTo(NonceValue) == 0)
{
System.out.println("Nonce values match");
}
// You should also verify the plan and subscription information
}
catch(Exception ex)
{
System.out.println("Exception validating data: " + ex.getMessage());
}
}