ERUCES::TEAuthenticationContext
#include <teauthctx.h>
The TEAuthenticationContext class is an abstract class representing the authentication context in use.
This class is the base class for the TEUserAuthenticationContext, TELdapAuthenticationContext, TECookieAuthenticationContext, TESSLMutualAuthenticationContext, TEX509AuthenticationContext, TEGssapiAuthenticationContext and TEDelegatedAuthenticationContext classes.
© Pi Soft, 2018-2026 · Tricryption Engine 8.1
Inheritance
- Inherits ERUCES::TEObject
- Inherited by ERUCES::TECookieAuthenticationContext
- Inherited by ERUCES::TEDelegatedAuthenticationContext
- Inherited by ERUCES::TEGssapiAuthenticationContext
- Inherited by ERUCES::TELdapAuthenticationContext
- Inherited by ERUCES::TESSLMutualAuthenticationContext
- Inherited by ERUCES::TEUserAuthenticationContext
- Inherited by ERUCES::TEX509AuthenticationContext
Public Types
enum AUTH_CTX_TYPE
Authentication context type.
| Value | Description |
|---|---|
Unset | No context class has set a type. Never returned by a context the SDK makes; a subclass of TEAuthenticationContext written outside the SDK that does not set its type reads this, not garbage (TE81-449). |
UserAndPassword | ERUCES Native user and password authentication context (using SRP). |
CodeAccess | Retired: the code-access (trusted component) authentication context. No context class sets this value and no key server module accepts it; the value stays reserved. |
UserAndPassword_V1 | Deprecated |
LDAP | LDAP authentication context. |
TOKEN | Token authentication context. |
X509 | The X.509 authentication context. For PKCS -11,12 authentication see SSLMutualConnection. |
GSSAPI | GSS-API (Kerberos) authentication context, bound to the TLS channel (TEGssapiAuthenticationContext; Linux and Windows since ADR 0121 – a Windows client needs gssapi64.dll on its DLL search path). |
SSLMutual | TLS mutual-authentication / PKCS -12 context (TESSLMutualAuthenticationContext; the ks module SSLMutualAuthentication, which is not X509Authentication). Added TE81-449: until then that context set no type at all and getContextType() read an uninitialised member. Next free value after GSSAPI; 0x02 and 0x08 stay retired. |
Delegated | Delegated (impersonation) context: the ks module DelegatedAuthentication, AM04 (TEDelegatedAuthenticationContext). The DELEGATOR is the TLS client certificate the connection presents; the context names only whom to become. Added TE81-339 (W39 round 1, ADR-0126). |
enum AUTH_CTX_MODE
Authentication mode - for client engine only.
| Value | Description |
|---|---|
ON_LINE | on-line mode: client engine acts as a proxy for authentication |
OFF_LINE | off-line mode: client engine performs authentication |
Protected Attributes
| Type | Name | Description |
|---|---|---|
| TEConnection * | m_pConn | |
| te_oid | m_nID | |
| uint32_t | m_nMode | |
| _TESTD string * | m_pstrServer | |
| AUTH_CTX_TYPE | m_nType | |
| _TESTD string * | m_pstrCookie |
Protected Member Functions
| Member | Description |
|---|---|
TEAuthenticationContext() | The TEAuthenticationContext constructor is the default class constructor. |
TEAuthenticationContext(const TEAuthenticationContext &) | The TEAuthenticationContext constructor copies a TEAuthenticationContext object. |
Public Member Functions
| Member | Description |
|---|---|
~TEAuthenticationContext() | The TEAuthenticationContext destructor is the class destructor. |
TEAuthenticationContext & operator=(const TEAuthenticationContext &)=delete | Copy assignment is DELETED, for this class and every context derived from it. |
te_oid authenticate()=0 | The authenticate method authenticates a principal. |
AUTH_CTX_TYPE getContextType() const | The getContextType method gets the type of authentication in use. |
uint32_t getMode() const | The getMode method gets the local authentication mode. |
void setMode(const uint32_t mode) | The setMode method sets the local authentication mode. |
_TESTD string getRemoteServer() const | The getRemoteServer method gets the name of a remote server. |
void setRemoteServer(const _TESTD string &server) | The setRemoteServer method sets the name of a remote server. |
const _TESTD string getToken(bool encode=true) const | The getToken method returns a token. |
void attachConnection(TEConnection *pConn) | The attachConnection method attaches to a connection specified by a TEConnection pointer. |
void detachConnection() | The detachConnection method detaches a connection. |
Member Function Documentation
TEAuthenticationContext()
The TEAuthenticationContext constructor is the default class constructor.
TEAuthenticationContext(const TEAuthenticationContext &)
The TEAuthenticationContext constructor copies a TEAuthenticationContext object.
~TEAuthenticationContext()
The TEAuthenticationContext destructor is the class destructor.
TEAuthenticationContext & operator=(const TEAuthenticationContext &)=delete
Copy assignment is DELETED, for this class and every context derived from it.
A context is made by its class's getInstance and copied through clone() only – the copy constructors are not public – and the implicit assignment operator that stood beside that design until TE81-448 (W36 round 1) copied the owned string pointers, so the assignee and the source freed them twice. Assign nothing; clone() what you need.
te_oid authenticate()=0
The authenticate method authenticates a principal.
Returns: Returns a long integer representing the Principal ID of the principal.
AUTH_CTX_TYPE getContextType() const
The getContextType method gets the type of authentication in use.
Returns: Returns an integer representing the authentication type: TEAuthenticationContext::UserAndPassword = ERUCES Native username and password-based authentication; TEAuthenticationContext::CodeAccess = code-based authentication; TEAuthenticationContext::LDAP = LDAP based authentication. TEAuthenticationContext::TOKEN = Token based authentication.
uint32_t getMode() const
The getMode method gets the local authentication mode.
Returns: Returns an integer representing the local authentication mode; TEAuthenticationContext::ON_LINE = online mode; TEAuthenticationContext::OFF_LINE = offline mode.
void setMode(const uint32_t mode)
The setMode method sets the local authentication mode.
Parameters
| Parameter | Description |
|---|---|
mode | An integer representing the local authentication mode to be set; TEAuthenticationContext::ON_LINE = online mode TEAuthenticationContext::OFF_LINE = offline mode. |
_TESTD string getRemoteServer() const
The getRemoteServer method gets the name of a remote server.
Returns: Returns a string representing the name of a remote server.
void setRemoteServer(const _TESTD string &server)
The setRemoteServer method sets the name of a remote server.
Parameters
| Parameter | Description |
|---|---|
server | A string representing the name of a remote server. |
const _TESTD string getToken(bool encode=true) const
The getToken method returns a token.
Returns: String of token. (Token is in binary array format)
void attachConnection(TEConnection *pConn)
The attachConnection method attaches to a connection specified by a TEConnection pointer.
Parameters
| Parameter | Description |
|---|---|
pConn | A pointer to an existing TEConnection object. |
void detachConnection()
The detachConnection method detaches a connection.