Diffusion C API  5.9.24
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
security.h File Reference

Functions handling authorisation, security and user credentials. More...

Functions

CREDENTIALS_Tcredentials_create_none (void)
 Create an empty set of credentials. More...
 
CREDENTIALS_Tcredentials_create_password (const char *password)
 Create credentials for a given password. More...
 
CREDENTIALS_Tcredentials_create_custom (const char *data, const unsigned long len)
 Create custom credentials, where the caller provides an opaque set of bytes. More...
 
void credentials_free (CREDENTIALS_T *creds)
 Free a credentials structure. More...
 
char * buf_read_credentials (const char *data, CREDENTIALS_T **credentials)
 Deserialise credentials from a stream of wire format data. More...
 
CREDENTIALS_Tcredentials_unmarshal (const BUF_T *buf)
 Deserialise a credentials structure from a wire format BUF_T. More...
 
BUF_Tcredentials_marshal (const CREDENTIALS_T *credentials)
 Serialise a credentials structure to wire format. More...
 

Detailed Description

Functions handling authorisation, security and user credentials.

Copyright © 2014, 2015 Push Technology Ltd., All Rights Reserved.

Use is subject to license terms.

NOTICE: All information contained herein is, and remains the property of Push Technology. The intellectual and technical concepts contained herein are proprietary to Push Technology and may be covered by U.S. and Foreign Patents, patents in process, and are protected by trade secret or copyright law.

Function Documentation

char* buf_read_credentials ( const char *  data,
CREDENTIALS_T **  credentials 
)

Deserialise credentials from a stream of wire format data.

Parameters
dataPointer the the start of a serialised credentials structure in a char array.
credentialsA created credentials structure.
Returns
A pointer to the position in the char array after the credentials structure.
CREDENTIALS_T* credentials_create_custom ( const char *  data,
const unsigned long  len 
)

Create custom credentials, where the caller provides an opaque set of bytes.

Parameters
dataAn array of bytes representing the credentials.
lenThe length of the array.
Return values
CREDENTIALS_T *Credentials with a type of "CUSTOM".
NULLIf an error occurs.
CREDENTIALS_T* credentials_create_none ( void  )

Create an empty set of credentials.

Return values
CREDENTIALS_T *Credentials with a type of "NONE".
NULLIf an error occurs.
CREDENTIALS_T* credentials_create_password ( const char *  password)

Create credentials for a given password.

Parameters
passwordThe password to encode into the credentials.
Return values
CREDENTIALS_T *Credentials with a type of "PLAIN_PASSWORD".
NULLIf an error occurs.
void credentials_free ( CREDENTIALS_T creds)

Free a credentials structure.

It is the responsibility of the caller to free any memory associated with the credentials data (either a password or custom data).

Parameters
credsA set of credentials.
BUF_T* credentials_marshal ( const CREDENTIALS_T credentials)

Serialise a credentials structure to wire format.

Parameters
credentialsA credentials structure to be serialised.
Return values
BUF_T *A buffer with the credentials in wire format.
NULLIf an error occurs.
CREDENTIALS_T* credentials_unmarshal ( const BUF_T buf)

Deserialise a credentials structure from a wire format BUF_T.

Parameters
bufThe buffer containing the serialised credentials.
Return values
CREDENTIALS_T *A credentials structure.
NULLIf an error occurs.