S2OPC OPCUA Toolkit
Loading...
Searching...
No Matches
sopc_sk_manager.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 SOPC_SK_MANAGER_H_
29#define SOPC_SK_MANAGER_H_
30
31#include <stdbool.h>
32#include <stdint.h>
33
34#include "sopc_builtintypes.h"
35#include "sopc_enums.h"
36
37#ifndef SOPC_SK_MANAGER_CURRENT_TOKEN_ID
38#define SOPC_SK_MANAGER_CURRENT_TOKEN_ID 0
39#endif
40
41/* Default KeyLifetime 1 hour */
42#ifndef SOPC_SK_MANAGER_DEFAULT_KEYLIFETIME
43#define SOPC_SK_MANAGER_DEFAULT_KEYLIFETIME (60 * 60 * 1000)
44#endif
45
46#ifndef SOPC_SK_MANAGER_DEFAULT_INITIAL_SIZE
47#define SOPC_SK_MANAGER_DEFAULT_INITIAL_SIZE 10
48#endif
49
51
57
59
61
63 SOPC_String* SecurityPolicyUri);
64
66 SOPC_String* SecurityPolicyUri,
67 uint32_t FirstTokenId,
68 SOPC_ByteString* Keys,
69 uint32_t NbKeys,
70 uint32_t TimeToNextKey,
71 uint32_t KeyLifetime);
72typedef uint32_t (*SOPC_SKManager_AddKeys_Func)(SOPC_SKManager* skm, SOPC_ByteString* Keys, uint32_t NbToken);
73
75 uint32_t StartingTokenId,
76 uint32_t NbRequestedToken,
77 SOPC_String** SecurityPolicyUri,
78 uint32_t* FirstTokenId,
79 SOPC_ByteString** Keys,
80 uint32_t* NbKeys,
81 uint32_t* TimeToNextKey,
82 uint32_t* KeyLifetime);
84
97
104
112
122
131
147 SOPC_String* SecurityPolicyUri,
148 uint32_t FirstTokenId,
149 SOPC_ByteString* Keys,
150 uint32_t NbKeys,
151 uint32_t TimeToNextKey,
152 uint32_t KeyLifetime);
153
166uint32_t SOPC_SKManager_AddKeys(SOPC_SKManager* skm, SOPC_ByteString* Keys, uint32_t NbToken);
167
185 uint32_t StartingTokenId,
186 uint32_t NbRequestedToken,
187 SOPC_String** SecurityPolicyUri,
188 uint32_t* FirstTokenId,
189 SOPC_ByteString** Keys,
190 uint32_t* NbKeys,
191 uint32_t* TimeToNextKey,
192 uint32_t* KeyLifetime);
193
201
208
209#endif /* SOPC_SK_MANAGER_H_ */
enum _SOPC_ReturnStatus SOPC_ReturnStatus
Common enumerations for S2OPC.
uint32_t(* SOPC_SKManager_AddKeys_Func)(SOPC_SKManager *skm, SOPC_ByteString *Keys, uint32_t NbToken)
Definition sopc_sk_manager.h:72
uint32_t SOPC_SKManager_Size(SOPC_SKManager *skm)
Gets number of managed Token for a given security group.
uint32_t(* SOPC_SKManager_GetSize_Func)(SOPC_SKManager *skm)
Type of functions to get size of the Security Key Manager.
Definition sopc_sk_manager.h:56
SOPC_SKManager * SOPC_SKManager_Create(void)
Creates an instance of the default SOPC_SKManager.
SOPC_ReturnStatus SOPC_SKManager_GetKeys(SOPC_SKManager *skm, uint32_t StartingTokenId, uint32_t NbRequestedToken, SOPC_String **SecurityPolicyUri, uint32_t *FirstTokenId, SOPC_ByteString **Keys, uint32_t *NbKeys, uint32_t *TimeToNextKey, uint32_t *KeyLifetime)
Gets Keys of a Security Keys Manager for a given security group. All returned data are copied by this...
SOPC_ReturnStatus SOPC_SKManager_SetKeyLifetime(SOPC_SKManager *skm, uint32_t KeyLifetime)
Sets the keys tokens lifetimes.
void SOPC_SKManager_Clear(SOPC_SKManager *skm)
Deallocates Security Keys Manager data bytes content.
SOPC_ReturnStatus(* SOPC_SKManager_SetKeyLifetime_Func)(SOPC_SKManager *skm, uint32_t KeyLifetime)
Definition sopc_sk_manager.h:58
SOPC_ReturnStatus(* SOPC_SKManager_GetKeys_Func)(SOPC_SKManager *skm, uint32_t StartingTokenId, uint32_t NbRequestedToken, SOPC_String **SecurityPolicyUri, uint32_t *FirstTokenId, SOPC_ByteString **Keys, uint32_t *NbKeys, uint32_t *TimeToNextKey, uint32_t *KeyLifetime)
Definition sopc_sk_manager.h:74
SOPC_ReturnStatus(* SOPC_SKManager_SetKeys_Func)(SOPC_SKManager *skm, SOPC_String *SecurityPolicyUri, uint32_t FirstTokenId, SOPC_ByteString *Keys, uint32_t NbKeys, uint32_t TimeToNextKey, uint32_t KeyLifetime)
Definition sopc_sk_manager.h:65
SOPC_ReturnStatus SOPC_SKManager_SetKeys(SOPC_SKManager *skm, SOPC_String *SecurityPolicyUri, uint32_t FirstTokenId, SOPC_ByteString *Keys, uint32_t NbKeys, uint32_t TimeToNextKey, uint32_t KeyLifetime)
Sets Keys of a Security Keys Manager for a given security group. After this function returns ( no mat...
uint32_t SOPC_SKManager_GetAllKeysLifeTime(SOPC_SKManager *skm)
Returns the total remaining lifetime of available keys tokens.
uint32_t(* SOPC_SKManager_GetAllKeysLifeTime_Func)(SOPC_SKManager *skm)
Definition sopc_sk_manager.h:60
SOPC_ReturnStatus SOPC_SKManager_SetSecurityPolicyUri(SOPC_SKManager *skm, SOPC_String *SecurityPolicyUri)
Sets the security policy URI for the security keys tokens.
SOPC_ReturnStatus(* SOPC_SKManager_SetSecurityPolicyUri_Func)(SOPC_SKManager *skm, SOPC_String *SecurityPolicyUri)
Definition sopc_sk_manager.h:62
uint32_t SOPC_SKManager_AddKeys(SOPC_SKManager *skm, SOPC_ByteString *Keys, uint32_t NbToken)
Adds Keys to a Security Keys Manager for a given security group. New keys are appended to the end of ...
void(* SOPC_SKManager_Clear_Func)(SOPC_SKManager *skm)
Definition sopc_sk_manager.h:83
Definition sopc_sk_manager.h:86
SOPC_SKManager_GetSize_Func ptrSize
Definition sopc_sk_manager.h:87
SOPC_SKManager_SetSecurityPolicyUri_Func ptrSetPolicy
Definition sopc_sk_manager.h:89
SOPC_SKManager_SetKeys_Func ptrSetKeys
Definition sopc_sk_manager.h:90
SOPC_SKManager_GetAllKeysLifeTime_Func ptrGetAllKeysLifeTime
Definition sopc_sk_manager.h:93
SOPC_SKManager_AddKeys_Func ptrAddKeys
Definition sopc_sk_manager.h:91
SOPC_SKManager_GetKeys_Func ptrGetKeys
Definition sopc_sk_manager.h:92
void * data
Definition sopc_sk_manager.h:95
SOPC_SKManager_Clear_Func ptrClear
Definition sopc_sk_manager.h:94
SOPC_SKManager_SetKeyLifetime_Func ptrSetKeyLifetime
Definition sopc_sk_manager.h:88
This structure provides string encapsulation.
Definition sopc_builtintypes.h:148