Security tokens

Manipulate and inspect security tokens. More...

Typedefs

typedef struct LWMsgSecurityToken LWMsgSecurityToken
 Security token object. More...
 

Functions

const char * lwmsg_security_token_get_type (LWMsgSecurityToken *token)
 Query security token type. More...
 
LWMsgBool lwmsg_security_token_equal (LWMsgSecurityToken *token, LWMsgSecurityToken *other)
 Compare two security tokens. More...
 
LWMsgBool lwmsg_security_token_can_access (LWMsgSecurityToken *token, LWMsgSecurityToken *other)
 Test access permissions. More...
 
LWMsgStatus lwmsg_security_token_copy (LWMsgSecurityToken *token, LWMsgSecurityToken **copy)
 Copy security token. More...
 
void lwmsg_security_token_delete (LWMsgSecurityToken *token)
 Delete security token. More...
 

Detailed Description

The security token interface provides an abstract means to access and set identification and credential information on an association. A security token always has a type which is expressed as a simple string constant. Once the type of a security token is established, it's contents can be accessed through functions specific to that type, e.g. lwmsg_local_token_get_eid() for tokens of type "local".

Security tokens can always be copied, compared, and deleted regardless of their type.

Typedef Documentation

An opaque structure representing a security token

Function Documentation

const char* lwmsg_security_token_get_type ( LWMsgSecurityToken token)

Gets the type of the specified security token as a simple string constant.

Parameters
[in]tokenthe token object
Returns
a string constant identifying the type of the token
LWMsgBool lwmsg_security_token_equal ( LWMsgSecurityToken token,
LWMsgSecurityToken other 
)

Compares two security tokens for equality. The equality logic used is determined by the first token.

Parameters
[in]tokenthe first token
[in]otherthe other token
Return values
LWMSG_TRUEthe tokens are equal
LWMSG_FALSEthe tokens are not equal
LWMsgBool lwmsg_security_token_can_access ( LWMsgSecurityToken token,
LWMsgSecurityToken other 
)

Determines if another security token is permitted to access resources owned by the first security token. This test is more general than the test for equality and may succeed for tokens that are not equal. The logic used is determined by the first token.

Parameters
[in]tokenthe first token
[in]otherthe other token
Return values
LWMSG_TRUEaccess is permitted
LWMSG_FALSEaccess is not permitted
LWMsgStatus lwmsg_security_token_copy ( LWMsgSecurityToken token,
LWMsgSecurityToken **  copy 
)

Creates an exact copy of a security token.

Parameters
[in]tokenthe token object
[out]copythe token copy
Return values
LWMSG_STATUS_SUCCESSsuccess
LWMSG_STATUS_MEMORYout of memory
void lwmsg_security_token_delete ( LWMsgSecurityToken token)

Deletes a security token.

Parameters
[in,out]tokenthe token object