ICertAdmin2::GetMyRoles method

The GetMyRoles method retrieves the certification authority (CA) roles of the caller.

Syntax


HRESULT GetMyRoles(
  [in]  const BSTR     strConfig,
  [out]       LONG *pRoles
);

Parameters

strConfig [in]

String value that represents a valid configuration string for the CA in the form COMPUTERNAME\CANAME, where COMPUTERNAME is the Certificate Services server's network name, and CANAME is the common name of the CA, as entered during Certificate Services setup. For information about the configuration string name, see ICertConfig.

Important  GetMyRoles does not clear the internal cache when the configuration string is changed. When you change the configuration string for the CA, you must instantiate a new ICertAdmin object and call this method again with the new configuration string.
 
pRoles [out]

A pointer to a LONG value that represents the retrieved CA roles for the caller. This can be a bitwise combination of zero or more of the following values.

ValueMeaning
CA_ACCESS_ADMIN
0x1

Caller has CA administrator capability.

CA_ACCESS_AUDITOR
0x4

Caller has CA auditor capability.

CA_ACCESS_ENROLL
0x200

Caller has enrollment access.

CA_ACCESS_OFFICER
0x2

Caller has CA officer capability.

CA_ACCESS_OPERATOR
0x8

Caller has CA backup capability.

CA_ACCESS_READ
0x100

Caller has CA read access.

 

Return value

C++

If the function is successful, the return value is S_OK.

If the function fails, the return value is an HRESULT that indicates the error. For a list of common error codes, see Common HRESULT Values.

VB

The return value is a Long value that represents the retrieved CA roles for the caller. This can be a bitwise combination of zero or more of the following values.

Return code/valueDescription
CA_ACCESS_ADMIN
0x1

Caller has CA administrator capability.

CA_ACCESS_AUDITOR
0x4

Caller has CA auditor capability.

CA_ACCESS_ENROLL
0x200

Caller has enrollment access.

CA_ACCESS_OFFICER
0x2

Caller has CA officer capability.

CA_ACCESS_OPERATOR
0x8

Caller has CA backup capability.

CA_ACCESS_READ
0x100

Caller has read access.

 

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Certadm.h (include Certsrv.h)

Library

Certidl.lib

DLL

Certadm.dll

IID

IID_ICertAdmin2 is defined as f7c3ac41-b8ce-4fb4-aa58-3d1dc0e36b39

See also

ICertAdmin2

 

 

Show: