ISCrdEnr::setUserName method

The setUserName method specifies the name of the user on whose behalf the certificate enrollment is intended.

Syntax

HRESULT setUserName(
  [in] DWORD dwFlags,
  [in] BSTR bstrUserName
);

SCrdEnr.setUserName( _
  ByVal dwFlags, _
  ByVal bstrUserName _
)

Parameters

dwFlags [in]

This value must be either SCARD_ENROLL_UPN_NAME (defined as 1) or SCARD_ENROLL_SAM_COMPATIBLE_NAME (defined as 2).

Set this value to SCARD_ENROLL_UPN_NAME, if the name specified in bstrUserName is the user's Universal Principal Name, such as "someone@example.com". The user's UPN name must correspond to an existing security access manager (SAM) name.

Set this value to SCARD_ENROLL_SAM_COMPATIBLE_NAME, if the name specified in bstrUserName is the user's SAM name in the format of "DOMAIN\USER".

bstrUserName [in]

Name of the user.

Return value

VB

If the method succeeds, the method returns S_OK.

If the method fails, it returns an HRESULT value that indicates the error. For a list of common error codes, see Common HRESULT Values.

Remarks

Call this method to specify the user name to be issued the smart card. An alternative to setUserName is ISCrdEnr::selectUserName.

After a user name has been specified, its value can be retrieved by calling getUserName.

Requirements

Requirement Value
Minimum supported client
None supported
Minimum supported server
Windows Server 2003 [desktop apps only]
DLL
Scrdenrl.dll
IID
IID_ISCrdEnr is defined as 753988a1-1357-436d-9cf5-f089bdd67d64

See also

ISCrdEnr

ISCrdEnr::getUserName

ISCrdEnr::resetUser

ISCrdEnr::selectUserName