Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 11th, 2008, 02:33 AM
Registered User
Join Date: Aug 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Certificate verification using online CRL and C#

I wanted to validate a digital certificate using online CRL and C#. To do the task, I use X509Certificate2 and X509Chain class. I get "RevocationStatusUnknown" as status of the code I use. CRL of the certificate is accessible using Internet Explorer. But the same is not happening through code I suppose. Is there any sort of access permissions we need to set up @ IIS level in order to access CRL through code?. Could some one please throw light on this?.

Here, the code is running on localhost from where the CRL is accessible using IE.
Following is the code I use :-

string status = "";
X509Chain chain = new X509Chain();
chain.ChainPolicy.RevocationMode = X509RevocationMode.Online;
chain.ChainPolicy.RevocationFlag = X509RevocationFlag.EntireChain;
chain.ChainPolicy.UrlRetrievalTimeout = new TimeSpan(1000);
chain.ChainPolicy.VerificationFlags = X509VerificationFlags.NoFlag ;
chain.ChainPolicy.VerificationTime = DateTime.Now;
string strCertificate = Server.MapPath(".\\ThawteFreeCertificate.pfx");
X509Certificate2 Cert = new X509Certificate2(strCertificate, "123456");
chain.Build(Cert );
foreach (X509ChainStatus s in chain.ChainStatus)
    string str = s.Status.ToString();
    if (!str.Equals(""))
        status = s.Status.ToString();
        Response.Write("<br> Status :" + status);

Thanks In Advance

Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Verification System vinodhanandhan .NET Framework 1.x 0 December 10th, 2006 04:30 AM
login verification katie456 Access ASP 3 October 16th, 2005 01:47 PM
Email verification John K. King Javascript How-To 4 November 24th, 2004 03:59 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.