ERUCES::TEAdmin
#include <teadmin.h>
The TEAdmin class represents a Key Service administrator.
The TEAdmin class provides management of Native users.
Inheritance
- Inherited by ERUCES::TEAdminACL
- Inherited by ERUCES::TEAdminCertificate
- Inherited by ERUCES::TEAdminCodeSigning
- Inherited by ERUCES::TEAdminConfig
- Inherited by ERUCES::TEAdminEfefs
- Inherited by ERUCES::TEAdminLocal
- Inherited by ERUCES::TEAdminLog
- Inherited by ERUCES::TEAdminQuery
- Inherited by ERUCES::TEAdminTrustedExecutable
- Inherited by ERUCES::TEAdminTrustedServer
Public Types
enum PRINCIPAL_LIST_TYPE
The PRINCIPAL_LIST_TYPE enumeration indicates principal type.
| Value | Description |
|---|---|
PRINCIPAL_ALL | can be used to retrieve all types of principals except TEUserPasswordInfo_V1, which can only be retrieved using PRINCIPAL_USERANDPASSWORD_V1; Not supported by all server levels. |
PRINCIPAL_USERANDPASSWORD | Represents TEUserAndPassword (ERUCES Native) principals; Not supported by all server levels. |
PRINCIPAL_WINDOWS | Represents TEWindowsPrincipalInfo (Kerberos) principals; Not supported by all server levels. |
PRINCIPAL_GROUP | Represents TEGroupInfo Group principals. |
PRINCIPAL_LDAP | Represents TELDAPPrincipalInfo principals. |
PRINCIPAL_TRANSPORT | Represents TETransportPrincipalInfo transport principals. |
PRINCIPAL_UNIX | Represents TEUnixPrincipalInfo Unix/NIS principals. |
Protected Attributes
| Type | Name | Description |
|---|---|---|
| void * | m_pConn | |
| void * | m_pTEConn |
Public Member Functions
| Member | Description |
|---|---|
TEAdmin() | The TEAdmin constructor is the default class constructor. |
~TEAdmin() | The TEAdmin destructor is the class destructor. |
void attachConnection(TEConnection *conn) | The attachConnection method attaches a connection to the object. |
void detachConnection() | The detachConnection method detaches a connection from the object. |
void addPrincipal(const TEPrincipalInfo &principal1, TEPrincipalInfo &principal2) | The addPrincipal method adds a new principal to server. |
void removePrincipal(const TEPrincipalInfo &principal, const TEPrincipalInfo &principalReplace) | The removePrincipal method removes a principal from server. |
void removePrincipal(const TEPrincipalInfo &principal) | The removePrincipal method removes a principal from server. |
void updatePrincipal(TEPrincipalInfo &principal) | The updatePrincipal method updates a principal. |
void getPrincipal(const TEPrincipalInfo &principal1, TEPrincipalInfo &principal2) const | The getPrincipal method retrieves a principal from the server. |
void resetPassword(const _TESTD string &user, const _TESTD string &password) | The resetPassword method resets the current logon user's password. |
unsigned int getPrincipalList(PRINCIPAL_LIST_TYPE type, TEObjectContainer &container, uint32_t sid=0) const | The getPrincipal method gets a specific principal based on given principal type. |
bool getPrincipalByName(TEPrincipalInfo &principal) | The getPrincipalByName method gets a principal having a specific name. |
bool getPrincipalByID(TEPrincipalInfo &principal) | The getPrincipalById method gets a principal using a specific ID. |
_TESTD auto_ptr< TEPrincipalInfo > getPrincipalByID(te_oid pid, uint32_t sid=0) | The getPrincipalById method gets a principal using a specific principal ID and a specific system ID. |
void getPrincipalByID(TEObjectContainer &contIDs, TEObjectContainer &contPals) | The getPrincipalById method gets multiple principals using multiple IDs. |
void getPrincipalByID(TEObjectContainer &contIDs, TEObjectContainer &contSIDs, TEObjectContainer &contPals) | The getPrincipalById method gets multiple principals using multiple principal IDs and multiple system IDs. |
void addRole(const TEUserRole &role1, TEUserRole &role2) | The addRole method adds a role to the Key Service. |
void getRole(const TEUserRole &role1, TEUserRole &role2) const | The getRole method gets a role from the Key Service. |
void updateRole(TEUserRole &role) | The updateRole method updates information in a role object. |
void removeRole(te_oid rid) | The removeRole method removes a role from the Key Service. |
void getRoleList(TEObjectContainer &cont) const | The getRoleList method gets a list of all roles in the system. |
void assignRoles(TEPrincipalInfo &principal, TEObjectContainer &roles) | The assignRoles method assigns multiple roles to a principal. |
void removeRoles(TEPrincipalInfo &principal, TEObjectContainer &roles) | The removeRoles method removes multiple roles from a principal. |
void getOperationList(TEObjectContainer &ops) const | The getOperationList method gets a list of all operations in the system. |
bool issueCertificate(const _TESTD string &csr, _TESTD string &chain, _TESTD string &id) | The issueCertificate method issues a certificate. |
void renewCertificate(const _TESTD string &cert, _TESTD string &chain, _TESTD string &id) | The renewCertificate method renews a certificate. |
void resetTransportPrincipal(const _TESTD string &subject) | The resetTransportPrincipal method renews a transport principal certificate. |
void acceptCertificate(const _TESTD string &chain) | The acceptCertificate method adds a transport principal certificate to the system. |
uint32_t getSystemID() | The getSystemID method gets a system identifier for the currently connected Key Service. |
void getVersion(uint32_t *major, uint32_t *minor, uint32_t *build, uint32_t *edition, _TESTD string &ver) | The getVersion method gets version information for the currently connected Key Service. |
void getACL(const _TESTD string &hl, TEACLInfo &acl, bool decode=false) const | The getACL method gets ACL information for a specific TTag. |
void updateACL(short code, TEACLInfo &acl) | The updateACL method modifies ACL information. |
void assignGroups(TEPrincipalInfo &principal, TEObjectContainer &groups) | The assignGroups method assigns multiple groups to a principal. The given principal will become a member of all given groups. |
void removeGroups(TEPrincipalInfo &principal, TEObjectContainer &groups) | The removeGroups method removes a principal from multiple groups. |
void addPrincipalsToGroup(te_oid gid, TEObjectContainer &pids) | The addPrincipalsToGroup method adds multiple principals to a group. |
void removePrincipalsFromGroup(te_oid gid, TEObjectContainer &pids) | The removePrincipalsFromGroup method removes multiple principals from a group. |
Protected Member Functions
| Member | Description |
|---|---|
const void * getConnection() const | The getConnection method gets an attached connection object. |
Member Function Documentation
TEAdmin()
The TEAdmin constructor is the default class constructor.
~TEAdmin()
The TEAdmin destructor is the class destructor.
void attachConnection(TEConnection *conn)
The attachConnection method attaches a connection to the object.
Parameters
| Parameter | Description |
|---|---|
conn | pointer of connection object |
void detachConnection()
The detachConnection method detaches a connection from the object.
void addPrincipal(const TEPrincipalInfo &principal1, TEPrincipalInfo &principal2)
The addPrincipal method adds a new principal to server.
Parameters
| Parameter | Description |
|---|---|
principal1 | principal object to be added |
principal2 | principal object returned after it's been added. |
void removePrincipal(const TEPrincipalInfo &principal, const TEPrincipalInfo &principalReplace)
The removePrincipal method removes a principal from server.
Build-in principal cannot be removed.
Parameters
| Parameter | Description |
|---|---|
principal | principal object to be removed |
principalReplace | principal object which will take over ownership of all TTag of removal principal |
void removePrincipal(const TEPrincipalInfo &principal)
The removePrincipal method removes a principal from server.
Build-in role cannot be removed.
DeprecatedThis method is only workable for Database Edition.
Parameters
| Parameter | Description |
|---|---|
principal | principal to be removed |
void updatePrincipal(TEPrincipalInfo &principal)
The updatePrincipal method updates a principal.
Parameters
| Parameter | Description |
|---|---|
principal | principal object to be updated |
void getPrincipal(const TEPrincipalInfo &principal1, TEPrincipalInfo &principal2) const
The getPrincipal method retrieves a principal from the server.
Parameters
| Parameter | Description |
|---|---|
principal1 | input principal object with search criteria |
principal2 | output principal object |
void resetPassword(const _TESTD string &user, const _TESTD string &password)
The resetPassword method resets the current logon user's password.
Parameters
| Parameter | Description |
|---|---|
user | string of user name |
password | string of user's new password |
Remark: This method can be used for both Database Edition and File Protection Edition
unsigned int getPrincipalList(PRINCIPAL_LIST_TYPE type, TEObjectContainer &container, uint32_t sid=0) const
The getPrincipal method gets a specific principal based on given principal type.
Parameters
| Parameter | Description |
|---|---|
type | type of principals to be returned. See PRINCIPAL_LIST_TYPE. |
container | container of principals returned |
sid | Server's system ID. If sid=0, retrieve principals from local Key Service. If sid>0, try to retrieve principals from remote Key Servicewhich has the given system ID. |
Returns: number of principals returned
bool getPrincipalByName(TEPrincipalInfo &principal)
The getPrincipalByName method gets a principal having a specific name.
Parameters
| Parameter | Description |
|---|---|
principal | in/out principal object. It is used to pass principal type and name for fetching and to output detailed principal data. |
Returns: A boolean representing true-find a principal with given type and name. false-cannot find any principal with given type and name.
bool getPrincipalByID(TEPrincipalInfo &principal)
The getPrincipalById method gets a principal using a specific ID.
Parameters
| Parameter | Description |
|---|---|
principal | principal object which keeps principal ID for fetching and detailed output principal data |
Returns: A boolean representing true-find a principal with given principal ID false-cannot find any principal with given principal ID
_TESTD auto_ptr< TEPrincipalInfo > getPrincipalByID(te_oid pid, uint32_t sid=0)
The getPrincipalById method gets a principal using a specific principal ID and a specific system ID.
Parameters
| Parameter | Description |
|---|---|
pid | principal ID used to fetch principal object |
sid | system ID. If sid=0, retrieve principal from local Key Server. If sid>0, try to retrieve principal from remote Key Server which has the same system ID. |
Returns: principal object with given principal ID and system ID
void getPrincipalByID(TEObjectContainer &contIDs, TEObjectContainer &contPals)
The getPrincipalById method gets multiple principals using multiple IDs.
Parameters
| Parameter | Description |
|---|---|
contIDs | container of principal IDs. Type objects in the container must be TEOID. |
contPals | container of principal objects returned. Type objects in the container will be TEPrincipalInfo. |
void getPrincipalByID(TEObjectContainer &contIDs, TEObjectContainer &contSIDs, TEObjectContainer &contPals)
The getPrincipalById method gets multiple principals using multiple principal IDs and multiple system IDs.
Parameters
| Parameter | Description |
|---|---|
contIDs | container of principal IDs. Type objects in the container must be TEOID. |
contSIDs | container of systems IDs. Type objects in the container must be TEUInt32. If a system ID is 0, then corresponding principal will be retrieved from local Key Server. If the container is empty, all principals will be retrieved from local Key Server. |
contPals | container of principal objects returned. Type objects in the container will be TEPrincipalInfo. |
void addRole(const TEUserRole &role1, TEUserRole &role2)
The addRole method adds a role to the Key Service.
Parameters
| Parameter | Description |
|---|---|
role1 | Role object to be added |
role2 | Role object returned after it's been added. |
void getRole(const TEUserRole &role1, TEUserRole &role2) const
The getRole method gets a role from the Key Service.
Parameters
| Parameter | Description |
|---|---|
role1 | Rrole object used to pass search criteria. |
role2 | Role object returned. |
void updateRole(TEUserRole &role)
The updateRole method updates information in a role object.
Parameters
| Parameter | Description |
|---|---|
role | Role object to be updated. Role ID must be given. Build-in role cannot be updated. |
void removeRole(te_oid rid)
The removeRole method removes a role from the Key Service.
Parameters
| Parameter | Description |
|---|---|
rid | The role ID of role to be removed. |
void getRoleList(TEObjectContainer &cont) const
The getRoleList method gets a list of all roles in the system.
Parameters
| Parameter | Description |
|---|---|
cont | A container of roles returned. Type of object in container will be TERole. |
void assignRoles(TEPrincipalInfo &principal, TEObjectContainer &roles)
The assignRoles method assigns multiple roles to a principal.
Parameters
| Parameter | Description |
|---|---|
principal | The principal object to which roles assigned to. |
roles | A container holding multiple roles to be assigned to the principal. Type of object in the container must be TERole. |
void removeRoles(TEPrincipalInfo &principal, TEObjectContainer &roles)
The removeRoles method removes multiple roles from a principal.
Parameters
| Parameter | Description |
|---|---|
principal | The principal object from which roles remomved. |
roles | A container holding multiple roles to be assigned to the principal. Type of object in the container must be TERole. |
void getOperationList(TEObjectContainer &ops) const
The getOperationList method gets a list of all operations in the system.
Parameters
| Parameter | Description |
|---|---|
ops | A container to hold the operations returned. Type of object in the container will be TEOperation. |
bool issueCertificate(const _TESTD string &csr, _TESTD string &chain, _TESTD string &id)
The issueCertificate method issues a certificate.
Parameters
| Parameter | Description |
|---|---|
csr | A string representing a certificate request. |
chain | A returned certificate chain. |
id | A returned certificate ID. |
Returns: true - if certificate is issued, false - if submitted in pending request queue
void renewCertificate(const _TESTD string &cert, _TESTD string &chain, _TESTD string &id)
The renewCertificate method renews a certificate.
Parameters
| Parameter | Description |
|---|---|
cert | A string representing the certificate. |
chain | A returned certificate chain. |
id | A returned certificate ID. |
void resetTransportPrincipal(const _TESTD string &subject)
The resetTransportPrincipal method renews a transport principal certificate.
Parameters
| Parameter | Description |
|---|---|
subject | A string representing the transport principal subject. |
void acceptCertificate(const _TESTD string &chain)
The acceptCertificate method adds a transport principal certificate to the system.
Parameters
| Parameter | Description |
|---|---|
chain | A returned certificate chain. |
uint32_t getSystemID()
The getSystemID method gets a system identifier for the currently connected Key Service.
Returns: Returns an integer representing the system ID.
void getVersion(uint32_t *major, uint32_t *minor, uint32_t *build, uint32_t *edition, _TESTD string &ver)
The getVersion method gets version information for the currently connected Key Service.
Parameters
| Parameter | Description |
|---|---|
major | A pointer to an integer representing a major portion of the version information. |
minor | A pointer to an integer representing a minor portion of the version information. |
build | A pointer to an integer representing build information. |
edition | A pointer to an integer representing Key Service edition information. |
ver | A string representing all version information. |
void getACL(const _TESTD string &hl, TEACLInfo &acl, bool decode=false) const
The getACL method gets ACL information for a specific TTag.
Parameters
| Parameter | Description |
|---|---|
hl | A string representing a TTag. |
acl | A returned ACLInfo object. |
decode | A boolean value flag indicating whether the TTag is Base64 encoded; TRUE = TTag is Base64 encoded and must be decoded, FALSE = TTag is not Base64 encoded. |
void updateACL(short code, TEACLInfo &acl)
The updateACL method modifies ACL information.
Parameters
| Parameter | Description |
|---|---|
code | The modification mode to update ACL data. |
acl | The TEACLInfo object to be updated. |
void assignGroups(TEPrincipalInfo &principal, TEObjectContainer &groups)
The assignGroups method assigns multiple groups to a principal. The given principal will become a member of all given groups.
Parameters
| Parameter | Description |
|---|---|
principal | The principal to which the groups will be assigned. |
groups | container holding multiple group IDs; must be TEOID type objects. |
void removeGroups(TEPrincipalInfo &principal, TEObjectContainer &groups)
The removeGroups method removes a principal from multiple groups.
Parameters
| Parameter | Description |
|---|---|
principal | The principal object to be removed from the groups. |
groups | A container holding multiple IDs of the groups from which the principal will be removed. |
void addPrincipalsToGroup(te_oid gid, TEObjectContainer &pids)
The addPrincipalsToGroup method adds multiple principals to a group.
Parameters
| Parameter | Description |
|---|---|
gid | The ID of the group to which the principals will be added. |
pids | The IDs of the principals to be added to the group. |
void removePrincipalsFromGroup(te_oid gid, TEObjectContainer &pids)
The removePrincipalsFromGroup method removes multiple principals from a group.
Parameters
| Parameter | Description |
|---|---|
gid | The ID of the group from which the principals will be removed. |
pids | A container holding multiple IDs of the principals to be removed from the group. |
const void * getConnection() const
The getConnection method gets an attached connection object.
Returns: Returns a connection object pointer.