CertGetNameString(pCertContext, dwType, 0, pvTypePara, vbNullString, iStrlen) doesn t work

From: Klaus-Dieter Brinkmann (kd.brinkmann_at_t-online.de)
Date: 12/31/03


Date: Wed, 31 Dec 2003 16:35:48 +0100

Dr.K.D.Brinkmann

Walkmühlstrasse 10

65232 Taunusstein

eMail kd.brinkmann@t-online.de

In visual basic I try to read certificate informations al follow :

dwType = 3

pvTypePara = "2.5.4.7"

iStrlen = 0

iresult = CertGetNameString(pCertContext, dwType, 0, pvTypePara,
vbNullString, iStrlen)

iStrlen = iresult

strSubject = String(iStrlen, vbNullChar)

iresult = CertGetNameString(pCertContext, dwType, 0, pvTypePara, strSubject,
iStrlen)

The only result ist iresult = 1 and strSubject = " "

dwType = 4 will result in the correct resultu.

Do you have experiences with that function ?

Is there a function to write a CertContext ( adressed via pCertContext )
into a file .cer to import on other computers ?

Mit freundlichen Grüssen

Klaus-Dieter Brinkmann