Platform SDK: Smart Card Enrollment Control

ISCrdEnr::enroll

The enroll method is used to request a certificate on behalf of the user and store the resulting certificate on the user's smart card.

objSCEnroll.enroll(dwFlags As Long)

Parameters

objSCEnroll
Object expression that resolves to a SCrdEnr object.
dwFlags
Reserved for future use. Set this value to 0.

Return Values

This method has no return values.

Remarks

During the processing of this method, the resulting certificate will be available for storage on the smart card. Before the certificate is written to the smart card, the user will be prompted for the smart card PIN number and, if necessary, for confirmation to overwrite the smart card's existing credentials. If the user doesn't enter the correct PIN number, or if the user declines to overwrite the smart card's existing credentials, this method will fail.

When re-issuing a smart card that previously contained a certificate, it may be necessary to run vendor-specific personalization software (prior to enrolling with the Smart Card Enrollment control) to ensure that a different public/private key pair is generated for the smart card. Consult your smart card vendor's documentation for instructions.

Valid names for the following items are mandatory for this method to be successful.

Names required for Names assigned by
Certification authority (CA) ISCrdEnr::setCAName method.
Certificate template ISCrdEnr::setCertTemplateName method.
Cryptographic Service Provider ISCrdEnr::CSPName property.
Signing certificate ISCrdEnr::selectSigningCertificate method or ISCrdEnr::setSigningCertificate method.
User ISCrdEnr::selectUserName method or ISCrdEnr::setUserName method.

The caller can retrieve the resulting certificate by means of ISCrdEnr::getEnrolledCertificateName.

Example Code in VBScript

' Senroll is a previously instantiated SCrdEnr object.
Senroll.enroll(0)

Requirements

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

See Also

ISCrdEnr::getEnrolledCertificateName