Platform SDK: Smart Card Enrollment Control

ISCrdEnr::getSigningCertificateName

The getSigningCertificateName method retrieves the subject name from the signing certificate. This method can also be used to display the certificate in a dialog box. This method calls the CryptoAPI function CertGetNameString.

objSCEnroll.getSigningCertificateName( _
    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 signing certificate is not displayed; any other values result in the signing certificate being displayed in the Certificate dialog box.

Return Values

String representing the name of the signing certificate. The signing certificate will be used to sign the certificate request.

Remarks

The getSigningCertificateName method returns the subject name of the certificate you (or another administrator) have selected in a previous successful call to ISCrdEnr::selectSigningCertificate or ISCrdEnr::setSigningCertificate. This method calls the CertGetNameString function to retrieve the subject 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 strSignCert

' Retrieve the name of the signing certificate and
' display the Certificate dialog box.
strSignCert = Senroll.getSigningCertificateName(0)

' Retrieve the name of the signing certificate
' without displaying the certificate dialog box.
strSignCert = Senroll.getSigningCertificateName(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::selectSigningCertificate