Certificate extensions via .NET and P/Invoke

From: Michel Gallant (neutron_at_nspxistar.ca)
Date: 10/04/03


Date: Fri, 3 Oct 2003 22:19:54 -0400

Quite a few folks have asked how to access X509 certificate extensions
from .NET code.
Currently System.Security.Cryptography.X509Certificates.X509Certificate
has only basic support for accessing certificate fields, but no support for
extensions and no support for CryptoAPI certificate stores.

Some of this is (evidently) coming in Whidbey and will be very welcome.

Meanwhile, and to support .NET 1.0/1.1, here is some sample code
showing how to access all the standard extensions for a certificate in a
CryptoAPI certificate store, and how to decode the extensions and marshal
data in the returned decoded structures:
   http://pages.istar.ca/~neutron/feature/CertAttributes

The code will demonstrate some standard techniques for marshaling data
and using IntPtr to access struct members.

- Michel Gallant
   Visual Security MVP



Relevant Pages

  • Certificate extensions via .NET and P/Invoke
    ... Quite a few folks have asked how to access X509 certificate extensions ... from .NET code. ... has only basic support for accessing certificate fields, ...
    (microsoft.public.platformsdk.security)
  • Re: OpenSSL
    ... | X.509v3 extension of the basic certificate. ... # X.509v3 extensions in its main section.) ... # the certificate can be used for anything *except* object signing. ... # Include email address in subject alt name: another PKIX recommendation ...
    (Fedora)
  • RE: netsh error - 1312
    ... \par Running the example from the article I was able to create the certificate ... \par Scott Norberg ... \par> Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: American Currency
    ... but a leaning to the left does not support that there is one. ... but that does not create evidence for the claim Obama was born ... And this will all depend on IF the supreme court will even try ... And you'll notice that he did provide his birth certificate too. ...
    (comp.sys.mac.advocacy)
  • Re: 0x80072f17 - Cert problem?
    ... after changing to a third-party certificate created by an Intermediate CA, ... cert for my CA? ... I am getting the same support code: ... In Windows Mobile 5.0 it's easier. ...
    (microsoft.public.pocketpc.activesync)

Quantcast