Platform SDK: Smart Card Enrollment Control

ISCrdEnr::getEnrolledCertificateName

The getEnrolledCertificateName method retrieves the name of the certificate resulting from an earlier successful call to ISCrdEnr::enroll. This method can also be used to display the certificate in a dialog box. This method calls the CryptoAPI function CertGetNameString.

objSCEnroll.getEnrolledCertificateName( _
            dwFlags As Long ) As String

Parameters

objSCEnroll
Object expression that resolves to a SCrdEnr object.
dwFlags
Value that determines whether the certificate is displayed in a dialog box. If this value is SCARD_ENROLL_NO_DISPLAY_CERT (defined as 0x01), the enrolled certificate is not displayed; any other values cause the enrolled certificate to be displayed in the Certificate dialog box.

Return Values

String representing the retrieved certificate name.

Remarks

Because this method operates on an existing certificate, you must have successfully called IScrdEnr::enroll before you can call getEnrolledCertificateName.

The getEnrolledCertificateName method calls the CertGetNameString function to retrieve the certificate name according to the sequence described for the CERT_NAME_SIMPLE_DISPLAY_TYPE value of CertGetNameString's dwType parameter.

Example Code in VBScript

' Define the constant.
Const SCARD_ENROLL_NO_DISPLAY_CERT = 1

Dim strEnrolledCert

' Retrieve the name of the enrolled certificate and
' display the certificate viewer dialog box.
strEnrolledCert = Senroll.getEnrolledCertificateName(0)

' Retrieve the name of the enrolled certificate
' without displaying the certificate viewer dialog box.
strEnrolledCert = Senroll.getEnrolledCertificateName(SCARD_ENROLL_NO_DISPLAY_CERT)

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Library: Included as a resource in Scrdenrl.dll.

See Also

ISCrdEnr::enroll