Platform SDK: Smart Card Enrollment Control

ISCrdEnr::enumCertTemplateName

The enumCertTemplateName method enumerates the certificate template names.

objSCEnroll.enumCertTemplateName( _
    dwIndex As Long, _
    dwFlags As Long) As String

Parameters

objSCEnroll
Object expression that resolves to a SCrdEnr object.
dwIndex
Zero-based index for the enumeration sequence.
dwFlags
Value which determines whether the enumerated certificate template applies to User or Machine certificates. If this value is SCARD_ENROLL_USER_CERT_TEMPLATE (defined as 1), the enumeration applies to user certificate templates. If this value is SCARD_ENROLL_MACHINE_CERT_TEMPLATE (defined as 2), the enumeration applies to machine certificate templates.

Return Values

String specifying the name of the enumerated certificate template.

Example Code in VBScript

' Define the constants.
Const SCARD_ENROLL_USER_CERT_TEMPLATE = 1
Const SCARD_ENROLL_MACHINE_CERT_TEMPLATE = 2

Dim nCount, nIndex, CertTempType

CertTempType = SCARD_ENROLL_USER_CERT_TEMPLATE

' Determine the count of certificate template names.
nCount = Senroll.getCertTemplateCount(CertTempType)
' Display the certificate template names.
For nIndex = 0 to nCount - 1
    MsgBox( Senroll.enumCertTemplateName( nIndex, CertTempType ) )
Next

Requirements

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

See Also

ISCrdEnr::getCertTemplateCount, ISCrdEnr::getCertTemplateName, ISCrdEnr::setCertTemplateName