ICertAdmin2::GetMyRoles method (certadm.h)

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

Syntax

HRESULT GetMyRoles(
  const BSTR strConfig,
  LONG       *pRoles
);

Parameters

strConfig

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

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.

Value Meaning
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/value Description
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]
Target Platform Windows
Header certadm.h (include Certsrv.h)
Library Certidl.lib
DLL Certadm.dll

See also

ICertAdmin2