Re: How to get KeyUsage field given .NET X509Certificate instance?

From: Michel Gallant (neutron_at_istar.ca)
Date: 07/29/03


Date: Tue, 29 Jul 2003 09:47:28 -0400


Hi Joe,

CAPICOM has some utilities methods. Here is a simple
script approach, which first converts a byte array (body) to
a BSTR and then you can proceed. Similar approaches work
for .NET
 - Mitch Gallant

-------------
set oUtils = CreateObject("CAPICOM.Utilities")
set oCert = CreateObject("CAPICOM.Certificate")
 ... get byte array 'body' from somewhere
certStr = oUtils.ByteArrayToBinaryString(body)
oCert.Import(certStr)
oCert.Display()
---------------

"Joe Kaplan (MVP - ADSI)" <joseph.e.kaplan@removethis.accenture.com> wrote in message
news:%23GwG2hZVDHA.3376@tk2msftngp13.phx.gbl...
> Thanks. Import looks promising, but it takes a string and it isn't clear to
> me what format that should be from the documentation. Base64? Pretty
> vague...
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/security/certificate_import.asp?frame=true
>
> I'll check out your library as it sounds very promising.
>
> Joe K.
>
> "Pieter Philippaerts" <Pieter@nospam.mentalis.org> wrote in message
> news:%23Hy8xQVVDHA.3376@tk2msftngp13.phx.gbl...
> > "Joe Kaplan (MVP - ADSI)" <joseph.e.kaplan@removethis.accenture.com> wrote
> > > I'm trying to figure out a good way to get key usage information
> > > (such as what is returned from the CAPICOM KeyUsage
> > > object) if I have an instance of a .NET X509Certificate class.
> >
> > The .NET X509Certificate class does not have too many options, so you
> might
> > want to consider switching to some other library that offers more options.
> > CAPICOM is one choice, but for a non-COM way check out the Certificate
> > Services library at http://www.mentalis.org/soft/projects/certificates/ It
> > has a Certificate class that works like the .NET X509Certificate class but
> > it has more options, including a method called GetIntendedKeyUsage that
> > returns what you're looking for.
> >
> > > I guess I'm not sure how to instantiate a CAPICOM Certificate
> > > object given a byte[]. Any ideas?
> >
> > Have you looked at Certificate.Import ?
> >
> > Regards,
> > Pieter Philippaerts
> > Managed SSL/TLS: http://www.mentalis.org/go.php?sl
> >
> >
>
>



Relevant Pages

  • Re: How to get KeyUsage field given .NET X509Certificate instance?
    ... > Hi Joe, ... > CAPICOM has some utilities methods. ... > script approach, which first converts a byte array to ... >> I'll check out your library as it sounds very promising. ...
    (microsoft.public.dotnet.security)
  • Re: passing a string to a dll
    ... Joe, I really appreciate you taking the time to demonstrate this. ... sure how I would implement indexing it for random alphanumeric codes. ... I might handle the array. ... I actually have been wondering if I could use a second string ...
    (microsoft.public.vc.mfc)
  • Re: passing a string to a dll
    ... I might handle the array. ... I actually have been wondering if I could use a second string ... look at insertion cost, organization cost, and search cost. ...
    (microsoft.public.vc.mfc)
  • Re: WindowsPrincipal.IsInRole() showing strange behavior
    ... Thanks, Joe. ... That array is populated with a call to unmanaged code that is essentially ... or perhaps there is a bigger problem in how the ... > I forgot to mention that part of the process, but I tried logging off/on, ...
    (microsoft.public.dotnet.security)
  • Re: Single Array from Multiple Ranges
    ... Thanks for the input Alan. ... Your web site and your array ... >Joe Adams wrote: ... >> but if I try to enter a range from a second worksheet, ...
    (microsoft.public.excel.programming)