Is it possible to generate hash of a file using certificate information? I have certificate details like this
"details": {
"certificate": "XIIHBTCCBO2gAwIBAgIQGuE3Q0ztnKRiYRN.....",
"public_key": "XIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQE...."
},
Using this information I need to create a digestvalue. Assuming the digest value is hash of a file created using the above certificate.
I am using below code to generate hash, but not able to figure out how to use certificate as well.
public static string SHA256CheckSum(string filePath)
{
using (SHA256 SHA256 = SHA256Managed.Create())
{
using (FileStream fileStream = File.OpenRead(filePath))
return Convert.ToBase64String(SHA256.ComputeHash(fileStream));
}
}