Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: How to get the Name of a V2 Certificate Template with ICertView

76 views
Skip to first unread message

Saleh Matani

unread,
Feb 27, 2006, 2:53:55 AM2/27/06
to
Zemp Dominik schrieb:
> Hi
>
> How can I get the name of a V2 Certificate Template with ICertView /
> CCertView? At the moment, I get only the OID of this template and not the
> name itself!
>
> Can someone help me?
>
> Thanks
> Dominik

hello Dominik ,
I had also the same problem reading the Certificate Template Name with
ICertView and V2 Cert Templates , i did that with compair of Hex Values
,i have searched of a new certadmin.dll that understand V2 Extensions at
but the last one did not.

in the certificate extention V2 is a new Extension ID
"1.3.6.1.4.1.311.21.7"
this is an example in VB how to do that with ICertView


If objExt.GetName = "1.3.6.1.4.1.311.21.7" Then
CertificateType = objExt.GetValue(PROPTYPE_BINARY, CV_OUT_HEX)

If InStr(CertificateType, "16 81 38 83 a7 bf 76 86 e0 dd 58 02 01 65
02 01") > 47 Then Zertifikatstyp = "WINLOGON"

and it works fine.

Tipp: you will see this ExtensionID if you open a V2 Created Certificate
on Windows 2000.

Info:the old Extension ID of V1 was "1.3.6.1.4.1.311.20.2"


Saleh Matani

Zemp Dominik

unread,
Feb 27, 2006, 5:05:27 AM2/27/06
to
Hi Saleh

Thank you for your answer... But I have still a few questions! :-)

What means this value? (16 81 38 83 a7 bf 76 86 e0 dd 58 02 01 65 02 01)

> If InStr(CertificateType, "16 81 38 83 a7 bf 76 86 e0 dd 58 02 01 65
> 02 01") > 47 Then Zertifikatstyp = "WINLOGON"

And why "> 47" ?

Also, where do I have to use this code?

Here's my code...

Do Until objRow.Next = -1
objColumn = objRow.EnumCertViewColumn()

Do Until objColumn.Next = -1
Select Case objColumn.GetDisplayName
Case "Issued Request ID"
requestID = objColumn.GetValue(PROPTYPE_LONG)
Case "Issued Common Name"
commonName = objColumn.GetValue(PROPTYPE_STRING)
Case "Serial Number"
serialNumber = objColumn.GetValue(PROPTYPE_STRING)
Case "Certificate Template"
certificateTemplate =
objColumn.GetValue(PROPTYPE_STRING)
Case "Certificate Effective Date"
effectiveDate = objColumn.GetValue(PROPTYPE_DATE)
Case "Certificate Expiration Date"
expirationDate = objColumn.GetValue(PROPTYPE_DATE)
Case "Request Disposition"
requestDisposition =
objColumn.GetValue(PROPTYPE_LONG)
End Select
Loop


Thanks and Regards
Dominik

0 new messages