Last active
January 5, 2020 06:56
-
-
Save SumindaD/90739e03fe3a7023a3a996eb4d3c94cf 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> | |
/// Sign the image data with the given certificate and write to the xmlFilePath | |
/// </summary> | |
/// <param name="imageBuffer">Image data to sign</param> | |
/// <param name="certificateBuffer">Private key certificate byte[]</param> | |
/// <param name="certPassword">Private key certificate Password</param> | |
/// <param name="xmlFilePath">The path to save the signed XML</param> | |
public static void SignImage(byte[] imageBuffer, byte[] certificateBuffer,string certPassword, string xmlFilePath) | |
{ | |
var certificate = new X509Certificate2(certificateBuffer, certPassword); | |
var xmlDocumentBuffer = SerializeImageToXML(imageBuffer); | |
SignXMLDocument(xmlDocumentBuffer, certificate, xmlFilePath); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment