S2OPC OPCUA Toolkit
|
Security Keys Manager: manages local storage of the keys retrieved from the Security Keys Provider for the SKS. More...
Go to the source code of this file.
Data Structures | |
struct | SOPC_SKManager |
Macros | |
#define | SOPC_SK_MANAGER_CURRENT_TOKEN_ID 0 |
#define | SOPC_SK_MANAGER_DEFAULT_KEYLIFETIME (60 * 60 * 1000) |
#define | SOPC_SK_MANAGER_DEFAULT_INITIAL_SIZE 10 |
Typedefs | |
typedef struct SOPC_SKManager | SOPC_SKManager |
typedef uint32_t(* | SOPC_SKManager_GetSize_Func) (SOPC_SKManager *skm) |
Type of functions to get size of the Security Key Manager. | |
typedef SOPC_ReturnStatus(* | SOPC_SKManager_SetKeyLifetime_Func) (SOPC_SKManager *skm, uint32_t KeyLifetime) |
typedef uint32_t(* | SOPC_SKManager_GetAllKeysLifeTime_Func) (SOPC_SKManager *skm) |
typedef SOPC_ReturnStatus(* | SOPC_SKManager_SetSecurityPolicyUri_Func) (SOPC_SKManager *skm, SOPC_String *SecurityPolicyUri) |
typedef 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) |
typedef uint32_t(* | SOPC_SKManager_AddKeys_Func) (SOPC_SKManager *skm, SOPC_ByteString *Keys, uint32_t NbToken) |
typedef 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) |
typedef void(* | SOPC_SKManager_Clear_Func) (SOPC_SKManager *skm) |
Functions | |
SOPC_SKManager * | SOPC_SKManager_Create (void) |
Creates an instance of the default SOPC_SKManager. | |
uint32_t | SOPC_SKManager_Size (SOPC_SKManager *skm) |
Gets number of managed Token for a given security group. | |
SOPC_ReturnStatus | SOPC_SKManager_SetKeyLifetime (SOPC_SKManager *skm, uint32_t KeyLifetime) |
Sets the keys tokens lifetimes. | |
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_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 matter the status ), old Keys are forgotten and cannot be accessed anymore using this SKManager. All parameters are copied by this function. | |
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 the list of existing keys. If no keys was managed before calling this function, the first token id is set to 1 and is associated to the first new key. All parameters are copied by this function. | |
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 function. The caller is responsible for deleting these data. | |
uint32_t | SOPC_SKManager_GetAllKeysLifeTime (SOPC_SKManager *skm) |
Returns the total remaining lifetime of available keys tokens. | |
void | SOPC_SKManager_Clear (SOPC_SKManager *skm) |
Deallocates Security Keys Manager data bytes content. | |
Security Keys Manager: manages local storage of the keys retrieved from the Security Keys Provider for the SKS.
#define SOPC_SK_MANAGER_CURRENT_TOKEN_ID 0 |
#define SOPC_SK_MANAGER_DEFAULT_KEYLIFETIME (60 * 60 * 1000) |
#define SOPC_SK_MANAGER_DEFAULT_INITIAL_SIZE 10 |
typedef struct SOPC_SKManager SOPC_SKManager |
typedef uint32_t(* SOPC_SKManager_GetSize_Func) (SOPC_SKManager *skm) |
Type of functions to get size of the Security Key Manager.
typedef SOPC_ReturnStatus(* SOPC_SKManager_SetKeyLifetime_Func) (SOPC_SKManager *skm, uint32_t KeyLifetime) |
typedef uint32_t(* SOPC_SKManager_GetAllKeysLifeTime_Func) (SOPC_SKManager *skm) |
typedef SOPC_ReturnStatus(* SOPC_SKManager_SetSecurityPolicyUri_Func) (SOPC_SKManager *skm, SOPC_String *SecurityPolicyUri) |
typedef 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) |
typedef uint32_t(* SOPC_SKManager_AddKeys_Func) (SOPC_SKManager *skm, SOPC_ByteString *Keys, uint32_t NbToken) |
typedef 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) |
typedef void(* SOPC_SKManager_Clear_Func) (SOPC_SKManager *skm) |
SOPC_SKManager * SOPC_SKManager_Create | ( | void | ) |
Creates an instance of the default SOPC_SKManager.
uint32_t SOPC_SKManager_Size | ( | SOPC_SKManager * | skm | ) |
Gets number of managed Token for a given security group.
skm | Pointer to Security Keys Manager. Should not be NULL |
SOPC_ReturnStatus SOPC_SKManager_SetKeyLifetime | ( | SOPC_SKManager * | skm, |
uint32_t | KeyLifetime ) |
Sets the keys tokens lifetimes.
skm | Pointer to Security Keys Manager. Should not be NULL |
KeyLifetime | The keys token lifetime before keys token becomes invalid in milliseconds |
SOPC_ReturnStatus SOPC_SKManager_SetSecurityPolicyUri | ( | SOPC_SKManager * | skm, |
SOPC_String * | SecurityPolicyUri ) |
Sets the security policy URI for the security keys tokens.
skm | Pointer to Security Keys Manager. Should not be NULL |
SecurityPolicyUri | The URI for the set of algorithms and key lengths used to secure the messages |
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 matter the status ), old Keys are forgotten and cannot be accessed anymore using this SKManager. All parameters are copied by this function.
skm | Pointer to Security Keys Manager. Should not be NULL |
SecurityPolicyUri | The URI for the set of algorithms and key lengths used to secure the messages |
FirstTokenId | The SecurityTokenId of the first key in the array of returned keys. |
Keys | An ordered list of keys that are used when the KeyLifetime elapses |
NbKeys | The number of keys tokens in Keys array |
TimeToNextKey | The time, in milliseconds, before the CurrentKey is expected to expire |
KeyLifetime | The lifetime of a key in milliseconds |
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 the list of existing keys. If no keys was managed before calling this function, the first token id is set to 1 and is associated to the first new key. All parameters are copied by this function.
skm | Pointer to Security Keys Manager. Should not be NULL |
Keys | The keys data |
NbToken | The number of keys token (set of keys) to add |
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 function. The caller is responsible for deleting these data.
skm | Pointer to Security Keys Manager. Should not be NULL |
StartingTokenId | The current token is requested by passing 0. It can be a SecurityTokenId from the past to get a key valid for previously sent messages |
NbRequestedToken | The number of requested keys tokens which should be returned in the response |
SecurityPolicyUri | The URI for the set of algorithms and key lengths used to secure the messages |
FirstTokenId | The SecurityTokenId of the first key in the array of returned keys. |
Keys | An ordered list of keys that are used when the KeyLifetime elapses |
NbKeys | The number of keys tokens in Keys array |
TimeToNextKey | The time, in milliseconds, before the CurrentKey is expected to expire |
KeyLifetime | The lifetime of a key in milliseconds |
uint32_t SOPC_SKManager_GetAllKeysLifeTime | ( | SOPC_SKManager * | skm | ) |
Returns the total remaining lifetime of available keys tokens.
skm | Pointer to Security Keys Manager. Should not be NULL |
void SOPC_SKManager_Clear | ( | SOPC_SKManager * | skm | ) |
Deallocates Security Keys Manager data bytes content.
skm | Pointer to Security Keys Manager. Should not be NULL |