S2OPC OPCUA Toolkit
sopc_key_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 
30 #ifndef SOPC_KEY_MANAGER_H_
31 #define SOPC_KEY_MANAGER_H_
32 
33 #include "sopc_crypto_decl.h"
34 
35 // Must be included last
37 
38 /* ------------------------------------------------------------------------------------------------
39  * AsymmetricKey API
40  * ------------------------------------------------------------------------------------------------
41  */
42 
53  uint32_t len,
55 
68 
85  char* password,
86  uint32_t lenPassword);
87 
98  bool is_public,
100 
111  bool is_public,
112  SOPC_AsymmetricKey** res);
113 
120 
121 /* ------------------------------------------------------------------------------------------------
122  * Cert API
123  * ------------------------------------------------------------------------------------------------
124  */
125 
136  uint32_t len,
138 
149 
156 
166  SOPC_CertificateList** res);
167 
177 
187 
188 #endif /* SOPC_KEY_MANAGER_H_ */
SOPC_KeyManager_SerializedAsymmetricKey_Deserialize
SOPC_ReturnStatus SOPC_KeyManager_SerializedAsymmetricKey_Deserialize(const SOPC_SerializedAsymmetricKey *key, bool is_public, SOPC_AsymmetricKey **res)
Deserializes a serialized key.
SOPC_KeyManager_SerializedCRL_Data
const SOPC_Buffer * SOPC_KeyManager_SerializedCRL_Data(const SOPC_SerializedCRL *crl)
Returns the data held in a serialized CRL.
SOPC_KeyManager_SerializedCertificate_Deserialize
SOPC_ReturnStatus SOPC_KeyManager_SerializedCertificate_Deserialize(const SOPC_SerializedCertificate *cert, SOPC_CertificateList **res)
Deserializes a serialized certificate.
SOPC_CertificateList
The signed public key representation.
Definition: key_manager_cyclone.h:60
SOPC_KeyManager_SerializedCertificate_Data
const SOPC_Buffer * SOPC_KeyManager_SerializedCertificate_Data(const SOPC_SerializedCertificate *cert)
Returns the data held in a serialized certificate.
SOPC_SerializedAsymmetricKey
SOPC_SecretBuffer SOPC_SerializedAsymmetricKey
A serialized representation of an asymmetric key.
Definition: sopc_crypto_decl.h:70
sopc_crypto_decl.h
Defines the common declarations for the cryptographic objects. The structures and macros defined in t...
SOPC_KeyManager_SerializedAsymmetricKey_CreateFromFile
SOPC_ReturnStatus SOPC_KeyManager_SerializedAsymmetricKey_CreateFromFile(const char *path, SOPC_SerializedAsymmetricKey **key)
Creates a serialized asymmetric key from a file in DER or PEM format.
SOPC_Buffer
Bytes buffer structure.
Definition: sopc_buffer.h:38
SOPC_KeyManager_SerializedAsymmetricKey_CreateFromKey
SOPC_ReturnStatus SOPC_KeyManager_SerializedAsymmetricKey_CreateFromKey(const SOPC_AsymmetricKey *pKey, bool is_public, SOPC_SerializedAsymmetricKey **out)
Creates a serialized asymmetric key from an SOPC_AsymmetricKey structure.
SOPC_KeyManager_SerializedAsymmetricKey_CreateFromFile_WithPwd
SOPC_ReturnStatus SOPC_KeyManager_SerializedAsymmetricKey_CreateFromFile_WithPwd(const char *keyPath, SOPC_SerializedAsymmetricKey **key, char *password, uint32_t lenPassword)
Creates a serialized asymmetric key from a file in DER or PEM format with an optional password for th...
SOPC_KeyManager_SerializedAsymmetricKey_Delete
void SOPC_KeyManager_SerializedAsymmetricKey_Delete(SOPC_SerializedAsymmetricKey *key)
Releases all resources associated to a serialized asymmetric key.
SOPC_KeyManager_SerializedCertificate_Delete
void SOPC_KeyManager_SerializedCertificate_Delete(SOPC_SerializedCertificate *cert)
Releases all resources associated to a serialized certificate.
SOPC_KeyManager_SerializedCertificate_CreateFromFile
SOPC_ReturnStatus SOPC_KeyManager_SerializedCertificate_CreateFromFile(const char *path, SOPC_SerializedCertificate **cert)
Creates a serialized certificate from a file in DER or PEM format.
SOPC_AsymmetricKey
The asymmetric key representation.
Definition: key_manager_cyclone.h:42
SOPC_KeyManager_SerializedAsymmetricKey_CreateFromData
SOPC_ReturnStatus SOPC_KeyManager_SerializedAsymmetricKey_CreateFromData(const uint8_t *data, uint32_t len, SOPC_SerializedAsymmetricKey **key)
Creates a serialized asymmetric key from a DER or PEM payload.
SOPC_KeyManager_SerializedCertificate_CreateFromDER
SOPC_ReturnStatus SOPC_KeyManager_SerializedCertificate_CreateFromDER(const uint8_t *der, uint32_t len, SOPC_SerializedCertificate **cert)
Creates a serialized certificate from a DER payload.
sopc_key_manager_lib_itf.h
Defines the cryptographic abstraction interface for Asymmetric Key Management such as loading signed ...
SOPC_ReturnStatus
SOPC_ReturnStatus
Definition: libs2opc_client.h:64