S2OPC OPCUA Toolkit
Typedefs | Functions
libs2opc_client_config.h File Reference

High level interface to configure an OPC UA client. More...

#include <stdbool.h>
#include "sopc_builtintypes.h"

Go to the source code of this file.

Typedefs

typedef bool SOPC_GetPassword_Fct(char **outPassword)
 Type of callback to retrieve password for decryption of the client application private key or the user x509 token private key. More...
 

Functions

SOPC_ReturnStatus SOPC_HelperConfigClient_SetClientKeyPasswordCallback (SOPC_GetPassword_Fct *getClientKeyPassword)
 Define the callback to retrieve password for decryption of the client private key. More...
 
SOPC_ReturnStatus SOPC_HelperConfigClient_SetUserKeyPasswordCallback (SOPC_GetPassword_Fct *getUserKeyPassword)
 Define the callback to retrieve password for decryption of the user X509 token private key. More...
 

Detailed Description

High level interface to configure an OPC UA client.

Typedef Documentation

◆ SOPC_GetPassword_Fct

typedef bool SOPC_GetPassword_Fct(char **outPassword)

Type of callback to retrieve password for decryption of the client application private key or the user x509 token private key.

Parameters
[out]outPasswordout parameter, the newly allocated password which shall be a zero-terminated string in case of success.
Returns
true in case of success, otherwise false.
Warning
The implementation of the user callback must free the outPassword and set it back to NULL in case of failure.

Function Documentation

◆ SOPC_HelperConfigClient_SetClientKeyPasswordCallback()

SOPC_ReturnStatus SOPC_HelperConfigClient_SetClientKeyPasswordCallback ( SOPC_GetPassword_Fct getClientKeyPassword)

Define the callback to retrieve password for decryption of the client private key.

This is optional but if used it shall be defined before starting client and loading its configuration.

Parameters
getClientKeyPasswordThe callback to retrieve the password
Returns
SOPC_STATUS_OK in case of success, otherwise SOPC_STATUS_INVALID_PARAMETERS if getClientKeyPassword is invalid.
Note
This function must be called before the configuration of the secure channel.

◆ SOPC_HelperConfigClient_SetUserKeyPasswordCallback()

SOPC_ReturnStatus SOPC_HelperConfigClient_SetUserKeyPasswordCallback ( SOPC_GetPassword_Fct getUserKeyPassword)

Define the callback to retrieve password for decryption of the user X509 token private key.

This is optional but if used it shall be defined before starting client and loading its configuration.

Parameters
getUserKeyPasswordThe callback to retrieve the password
Returns
SOPC_STATUS_OK in case of success, otherwise SOPC_STATUS_INVALID_PARAMETERS if getUserKeyPassword is invalid.
Note
This function must be called before the configuration of the secure channel.