S2OPC OPCUA Toolkit
libs2opc_client_config_custom.h
Go to the documentation of this file.
1 /*
2  * Licensed to Systerel under one or more contributor license
3  * agreements. See the NOTICE file distributed with this work
4  * for additional information regarding copyright ownership.
5  * Systerel licenses this file to you under the Apache
6  * License, Version 2.0 (the "License"); you may not use this
7  * file except in compliance with the License. You may obtain
8  * a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
28 #ifndef LIBS2OPC_CLIENT_CONFIG_CUSTOM_H_
29 #define LIBS2OPC_CLIENT_CONFIG_CUSTOM_H_
30 
31 #include <stdbool.h>
32 
33 #include "libs2opc_client_config.h"
34 #include "libs2opc_common_config.h"
35 
51 SOPC_ReturnStatus SOPC_ClientConfigHelper_SetPreferredLocaleIds(size_t nbLocales, const char** localeIds);
52 
69  const char* productUri,
70  const char* defaultAppName,
71  const char* defaultAppNameLocale,
72  OpcUa_ApplicationType applicationType);
73 
89 
104  const char* clientKeyPath,
105  bool encrypted);
106 
122  const unsigned char* clientCertificate,
123  size_t keyNbBytes,
124  const unsigned char* clientPrivateKey);
125 
148  const char* endpointUrl,
149  OpcUa_MessageSecurityMode secuMode,
150  SOPC_SecurityPolicy_URI secuPolicy);
151 
167  SOPC_SecureConnection_Config* secConnConfig,
168  const OpcUa_GetEndpointsResponse* getEndpointsResponse);
169 
183  const char* clientReverseEndpointUri);
184 
198  uint32_t reqLifetime);
199 
212  const char* serverCertPath);
213 
228  size_t certificateNbBytes,
229  const unsigned char* serverCertificate);
230 
246  const char* userPolicyId);
247 
266  const char* userPolicyId,
267  const char* userName,
268  const char* password);
269 
286  const char* userPolicyId,
287  const char* userCertPath,
288  const char* userKeyPath,
289  bool encrypted);
290 
308  const char* userPolicyId,
309  size_t certificateNbBytes,
310  const unsigned char* userCertificate,
311  size_t keyNbBytes,
312  const unsigned char* userPrivateKey);
313 
331  SOPC_KeyCertPairUpdateCb* serverCertUpdateCb,
332  uintptr_t updateParam);
333 
344  SOPC_SecureConnection_Config*** scConfigArray);
345 
346 #endif
libs2opc_client_config.h
High level interface to configure an OPC UA client.
SOPC_SecureConnectionConfig_SetReqLifetime
SOPC_ReturnStatus SOPC_SecureConnectionConfig_SetReqLifetime(SOPC_SecureConnection_Config *secConnConfig, uint32_t reqLifetime)
Defines the lifetime requested to the server for this secure connection (symmetric keys renewal) A de...
SOPC_PKIProvider
The PKIProvider object for the Public Key Infrastructure.
Definition: sopc_pki_struct_lib_internal.h:129
SOPC_SecureConnectionConfig_SetUserX509FromPaths
SOPC_ReturnStatus SOPC_SecureConnectionConfig_SetUserX509FromPaths(SOPC_SecureConnection_Config *secConnConfig, const char *userPolicyId, const char *userCertPath, const char *userKeyPath, bool encrypted)
Defines the user authentication mode as X509 certificate for the secure connection,...
SOPC_SecureConnectionConfig_SetReverseConnection
SOPC_ReturnStatus SOPC_SecureConnectionConfig_SetReverseConnection(SOPC_SecureConnection_Config *secConnConfig, const char *clientReverseEndpointUri)
Sets the Secure Connection in reverse connection mode.
SOPC_SecureConnectionConfig_SetServerCertUpdateCb
SOPC_ReturnStatus SOPC_SecureConnectionConfig_SetServerCertUpdateCb(SOPC_SecureConnection_Config *secConnConfig, SOPC_KeyCertPairUpdateCb *serverCertUpdateCb, uintptr_t updateParam)
Set the callback to be called if the server certificate held by SOPC_CertHolder is updated at runtime...
OpcUa_MessageSecurityMode
OpcUa_MessageSecurityMode
Definition: libs2opc_client.h:89
libs2opc_common_config.h
High level interface to configure an OPC UA client and/or server.
SOPC_KeyCertPairUpdateCb
void SOPC_KeyCertPairUpdateCb(uintptr_t updateParam)
Type of the callback triggered on key / certificate update.
Definition: sopc_key_cert_pair.h:46
SOPC_SecureConnectionConfig_SetUserX509FromBytes
SOPC_ReturnStatus SOPC_SecureConnectionConfig_SetUserX509FromBytes(SOPC_SecureConnection_Config *secConnConfig, const char *userPolicyId, size_t certificateNbBytes, const unsigned char *userCertificate, size_t keyNbBytes, const unsigned char *userPrivateKey)
Sets asymmetrical certificate and key of user from byte arrays. Certificate shall be in DER format,...
SOPC_ClientConfigHelper_SetKeyCertPairFromPath
SOPC_ReturnStatus SOPC_ClientConfigHelper_SetKeyCertPairFromPath(const char *clientCertPath, const char *clientKeyPath, bool encrypted)
Sets asymmetrical certificate and key of client from file paths. Certificate files shall use DER form...
_OpcUa_GetEndpointsResponse
Definition: sopc_types.h:2434
SOPC_ClientConfigHelper_SetPKIprovider
SOPC_ReturnStatus SOPC_ClientConfigHelper_SetPKIprovider(SOPC_PKIProvider *pki)
Defines the PKI provider that will be in charge of validating certificates received by client.
SOPC_SecureConnectionConfig_SetServerCertificateFromPath
SOPC_ReturnStatus SOPC_SecureConnectionConfig_SetServerCertificateFromPath(SOPC_SecureConnection_Config *secConnConfig, const char *serverCertPath)
Defines the server certificate DER file path to be used to establish the secure connection.
SOPC_ClientConfigHelper_CreateSecureConnection
SOPC_SecureConnection_Config * SOPC_ClientConfigHelper_CreateSecureConnection(const char *userDefinedId, const char *endpointUrl, OpcUa_MessageSecurityMode secuMode, SOPC_SecurityPolicy_URI secuPolicy)
Create a new secure channel configuration in client be completed by using the functions below (SOPC_S...
SOPC_ClientConfigHelper_SetPreferredLocaleIds
SOPC_ReturnStatus SOPC_ClientConfigHelper_SetPreferredLocaleIds(size_t nbLocales, const char **localeIds)
Client configuration without XML.
SOPC_ClientConfigHelper_SetKeyCertPairFromBytes
SOPC_ReturnStatus SOPC_ClientConfigHelper_SetKeyCertPairFromBytes(size_t certificateNbBytes, const unsigned char *clientCertificate, size_t keyNbBytes, const unsigned char *clientPrivateKey)
Sets asymmetrical certificate and key of client from byte arrays. Certificate shall be in DER format,...
SOPC_ClientConfigHelper_GetSecureConnectionConfigs
SOPC_ReturnStatus SOPC_ClientConfigHelper_GetSecureConnectionConfigs(size_t *nbScConfigs, SOPC_SecureConnection_Config ***scConfigArray)
Gets the configured secure connections array.
SOPC_SecureConnectionConfig_SetUserName
SOPC_ReturnStatus SOPC_SecureConnectionConfig_SetUserName(SOPC_SecureConnection_Config *secConnConfig, const char *userPolicyId, const char *userName, const char *password)
Defines the user authentication mode as username/password for the secure connection,...
SOPC_ClientConfigHelper_SetApplicationDescription
SOPC_ReturnStatus SOPC_ClientConfigHelper_SetApplicationDescription(const char *applicationUri, const char *productUri, const char *defaultAppName, const char *defaultAppNameLocale, OpcUa_ApplicationType applicationType)
Defines client application description.
SOPC_SecureConnection_Config
Structure representing a secure connection configuration (secure channel + session) which allow to es...
Definition: sopc_user_app_itf.h:221
SOPC_SecureConnectionConfig_SetAnonymous
SOPC_ReturnStatus SOPC_SecureConnectionConfig_SetAnonymous(SOPC_SecureConnection_Config *secConnConfig, const char *userPolicyId)
Defines the user authentication mode as anonymous for the secure connection and set the associated us...
SOPC_SecurityPolicy_URI
SOPC_SecurityPolicy_URI
Enumerated values authorized for use with SOPC_EndpointConfig_AddSecurityConfig or SOPC_ClientConfigH...
Definition: libs2opc_common_config.h:42
SOPC_SecureConnectionConfig_SetServerCertificateFromBytes
SOPC_ReturnStatus SOPC_SecureConnectionConfig_SetServerCertificateFromBytes(SOPC_SecureConnection_Config *secConnConfig, size_t certificateNbBytes, const unsigned char *serverCertificate)
Defines the server certificate DER encoded bytes to be used to establish the secure connection.
SOPC_SecureConnectionConfig_SetExpectedEndpointsDescription
SOPC_ReturnStatus SOPC_SecureConnectionConfig_SetExpectedEndpointsDescription(SOPC_SecureConnection_Config *secConnConfig, const OpcUa_GetEndpointsResponse *getEndpointsResponse)
Defines the Secure Connection expected EndpointsDescription from given GetEndpointsResponse....
OpcUa_ApplicationType
enum _OpcUa_ApplicationType OpcUa_ApplicationType
SOPC_ReturnStatus
SOPC_ReturnStatus
Definition: libs2opc_client.h:64