High Performance OPC UA Server SDK  1.3.1.248

For more information on the internal authentication backend and usage examples see Internal Backend. More...

Macros

#define UA_AUTH_HASH_NONE   0
 Identifier for no hash algorithm (cleartext password)
 
#define UA_AUTH_HASH_SHA256   1
 Identifier for SHA-256 hash algorithm.
 
#define UA_AUTH_HASH_SHA512   2
 Identifier for SHA-512 hash algorithm.
 

Functions

bool ua_authentication_user_exists (const struct ua_string *username)
 Check if a user exists for authentication. More...
 
ua_statuscode ua_authentication_check_password (const struct ua_string *username, const struct ua_bytestring *password)
 Check the password for a user. More...
 
int ua_authentication_add_user (uint8_t hash_alg, const char *username, const char *salt, const char *hash)
 Add a user to authentication. More...
 
int ua_authentication_remove_user (const char *username)
 Remove a user from authentication. More...
 
int ua_authorization_write_to_filestream (struct ua_filestream *stream)
 Write current users with passwords to a filedescriptor. More...
 

Detailed Description

For more information on the internal authentication backend and usage examples see Internal Backend.

Function Documentation

◆ ua_authentication_add_user()

int ua_authentication_add_user ( uint8_t  hash_alg,
const char *  username,
const char *  salt,
const char *  hash 
)

Add a user to authentication.

For an example how to use this function see Code.

Parameters
hash_algHash algorithm to use e.g. UA_AUTH_HASH_SHA256.
usernameName of the user add.
saltSalt to hash the password with.
hashThe password hash as hexadecimal string.
Returns
Zero on success or errorcode on failure.

◆ ua_authentication_check_password()

ua_statuscode ua_authentication_check_password ( const struct ua_string username,
const struct ua_bytestring password 
)

Check the password for a user.

Parameters
usernameName of the user.
passwordCleartext password the user provided.
Returns
Zero if the password is correct, bad statuscode otherwise.

◆ ua_authentication_remove_user()

int ua_authentication_remove_user ( const char *  username)

Remove a user from authentication.

Parameters
usernameName of the user to remove.
Returns
Zero on success or errorcode on failure.

◆ ua_authentication_user_exists()

bool ua_authentication_user_exists ( const struct ua_string username)

Check if a user exists for authentication.

Parameters
usernameName of the user.
Returns
True if user exists, false otherwise.

◆ ua_authorization_write_to_filestream()

int ua_authorization_write_to_filestream ( struct ua_filestream stream)

Write current users with passwords to a filedescriptor.

Parameters
fFiledescriptor to write information to.
Returns
Zero on success or errorcode on failure.