How to

validate X.509 certificate

Published: 28. December 2014 | Updated: 28. December 2014
License: Microsoft Public License (MS-PL)
Categories: Security
Tags: C# Security
Was this snippet helpful for you? YESYES / NONO
Get Analyzant!

Check your entire website from code to content in minutes with Analyzant, the free analysis suite.

Free download at

Import namespaces

using System;
using System.Security.Cryptography.X509Certificates;


// load certificate
var x509 = new X509Certificate2(X509Certificate.CreateFromSignedFile(@"C:\mySignedFile.exe"));

Console.WriteLine("Certificate is valid: {0}", x509.Verify());
Send us feedback about this snippet »

Related Snippets: