Platform SDK: Smart Card Enrollment Control

ISCrdEnr::getCAName

The getCAName method retrieves the name of the specified certification authority (CA) for a given certificate template.

objSCEnroll.getCAName( _
    dwFlags As Long, _
    bstrCertTemplateName As String) As String

Parameters

objSCEnroll
Object expression that resolves to a SCrdEnr object.
dwFlags
Value which specifies if the name refers to the CA name or the CA's machine name. If this value is SCARD_ENROLL_CA_MACHINE_NAME (defined as 0x01) then the name refers to the CA's machine name; otherwise the name refers to the CA name.
bstrCertTemplateName
Name of the certificate template.

Return Values

String representing the name of the CA.

Remarks

The default CA name is the first name in the available list of CAs.

Example Code in VBScript

' Define the constants.
Const SCARD_ENROLL_CA_MACHINE_NAME = 1

Dim strMachineName, strCAName, strCTName

strCTName = "User"

strMachineName = Senroll.getCAName( _
                 SCARD_ENROLL_CA_MACHINE_NAME, _
                 strCTName)

strCAName = Senroll.getCAName( _
            0, _
            strCTName)

MsgBox( strMachineName & "\" & strCAName )

Requirements

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

See Also

ISCrdEnr::enumCAName, ISCrdEnr::getCACount, ISCrdEnr::setCAName