Created
January 5, 2020 07:36
-
-
Save SumindaD/05150796efc5bcfe649a9e7f82996bc0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// Verify the integrity of the image by checking the signature using the certificate public key | |
| /// </summary> | |
| /// <param name="xmlFilePath">Path to the signed xml image document</param> | |
| /// <param name="certificateBuffer">The public key certificate byte[] to verify the integrity of the signed xml image document</param> | |
| /// <param name="certPassword">Private key certificate Password</param> | |
| /// <returns>True - If image integrity is intact. False - If image has been tampered with</returns> | |
| public static bool VerifyImage(string xmlFilePath, byte[] certificateBuffer, string certPassword) | |
| { | |
| var certificate = new X509Certificate2(certificateBuffer, certPassword); | |
| return VerifyXMLDocument(xmlFilePath, certificate); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment