Go to the documentation of this file.
30 #ifndef SOPC_KEY_MANAGER_H_
31 #define SOPC_KEY_MANAGER_H_
107 uint32_t lenPassword);
164 uint32_t* pLenWritten);
209 uint32_t lenPassword);
323 uint32_t* pLenAllocated);
389 char** ppApplicationUri,
390 size_t* pStringLength);
bool SOPC_KeyManager_Certificate_CheckApplicationUri(const SOPC_CertificateList *pCert, const char *applicationUri)
Verify the application URI embedded in a certificate.
SOPC_ReturnStatus SOPC_KeyManager_SerializedAsymmetricKey_Deserialize(const SOPC_SerializedAsymmetricKey *key, bool is_public, SOPC_AsymmetricKey **res)
Deserializes a serialized key.
SOPC_ReturnStatus SOPC_KeyManager_Certificate_CreateOrAddFromFile(const char *szPath, SOPC_CertificateList **ppCert)
Creates a new Certificate (signed public key) from a file in the DER or PEM format,...
SOPC_ReturnStatus SOPC_KeyManager_SerializedCertificate_Deserialize(const SOPC_SerializedCertificate *cert, SOPC_CertificateList **res)
Deserializes a serialized certificate.
The signed public key representation, or a chained list of such keys.
Definition: key_manager_lib.h:66
SOPC_Buffer SOPC_SerializedCertificate
A serialized representation of a certificate.
Definition: sopc_key_manager.h:51
SOPC_SecretBuffer SOPC_SerializedAsymmetricKey
A serialized representation of an asymmetric key.
Definition: sopc_key_manager.h:44
SOPC_ReturnStatus SOPC_KeyManager_CertificateList_FindCertInList(const SOPC_CertificateList *pList, const SOPC_CertificateList *pCert, bool *pbMatch)
Finds whether a certificate is in the given certificate list or not.
SOPC_ReturnStatus SOPC_KeyManager_Certificate_GetListLength(const SOPC_CertificateList *pCert, size_t *pLength)
Return the number of chained certificates in the certificate list pCert.
void SOPC_KeyManager_CRL_Free(SOPC_CRLList *pCRL)
Frees a Certificate created with SOPC_KeyManager_CRL_CreateOrAddFromFile() or SOPC_KeyManager_CRL_Cre...
const SOPC_Buffer * SOPC_KeyManager_SerializedCertificate_Data(const SOPC_SerializedCertificate *cert)
Returns the data held in a serialized certificate.
SOPC_ReturnStatus SOPC_KeyManager_Certificate_CreateOrAddFromDER(const uint8_t *bufferDER, uint32_t lenDER, SOPC_CertificateList **ppCert)
Creates a new Certificate (signed public key) from a DER encoded buffer, or add it to an existing cer...
Defines the common declarations for the cryptographic objects.
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_ReturnStatus SOPC_KeyManager_Certificate_GetMaybeApplicationUri(const SOPC_CertificateList *pCert, char **ppApplicationUri, size_t *pStringLength)
Copy the application URI embedded in a certificate.
SOPC_ReturnStatus SOPC_KeyManager_AsymmetricKey_CreateFromBuffer(const uint8_t *buffer, uint32_t lenBuf, bool is_public, SOPC_AsymmetricKey **ppKey)
Creates an asymmetric key (usually a private key) from in-memory buffer buffer.
SOPC_ReturnStatus SOPC_KeyManager_AsymmetricKey_ToDER(const SOPC_AsymmetricKey *pKey, bool is_public, uint8_t *pDest, uint32_t lenDest, uint32_t *pLenWritten)
Encodes the pKey as a DER buffer, and writes the result in pDest.
Bytes buffer structure.
Definition: sopc_buffer.h:38
The SOPC_CryptoProvider context.
Definition: sopc_crypto_provider.h:47
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_ReturnStatus SOPC_KeyManager_Certificate_ToDER(const SOPC_CertificateList *pCert, uint8_t **ppDest, uint32_t *pLenAllocated)
Encodes a pCert as a DER buffer and writes the result in ppDest.
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...
void SOPC_KeyManager_AsymmetricKey_Free(SOPC_AsymmetricKey *pKey)
Frees a previously created asymmetric key created with SOPC_KeyManager_AsymmetricKey_CreateFromBuffer...
char * SOPC_KeyManager_Certificate_GetCstring_SHA1(SOPC_CertificateList *pCert)
Returns the SHA-1 thumbprint of a certificate.
void SOPC_KeyManager_SerializedAsymmetricKey_Delete(SOPC_SerializedAsymmetricKey *key)
Releases all resources associated to a serialized asymmetric key.
SOPC_ReturnStatus SOPC_KeyManager_CRL_CreateOrAddFromDER(const uint8_t *bufferDER, uint32_t lenDER, SOPC_CRLList **ppCRL)
Creates a new Certificate Revocation List (CRL) from a DER encoded buffer, or add it to an existing C...
void SOPC_KeyManager_SerializedCertificate_Delete(SOPC_SerializedCertificate *cert)
Releases all resources associated to a serialized certificate.
SOPC_ReturnStatus SOPC_KeyManager_SerializedCertificate_CreateFromFile(const char *path, SOPC_SerializedCertificate **cert)
Creates a serialized certificate from a file in DER format.
The asymmetric key representation.
Definition: key_manager_lib.h:46
struct SOPC_SecretBuffer SOPC_SecretBuffer
Definition: sopc_secret_buffer.h:35
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_ReturnStatus SOPC_KeyManager_AsymmetricKey_CreateFromCertificate(const SOPC_CertificateList *pCert, SOPC_AsymmetricKey **pKey)
Returns the public key of the signed public key.
SOPC_ReturnStatus SOPC_KeyManager_CertificateList_RemoveUnmatchedCRL(SOPC_CertificateList *pCert, const SOPC_CRLList *pCRL, bool *pbMatch)
Removes (and frees) certificates from pCert that do not have exactly one revocation list in pCRL.
SOPC_ReturnStatus SOPC_KeyManager_Certificate_GetThumbprint(const SOPC_CryptoProvider *pProvider, const SOPC_CertificateList *pCert, uint8_t *pDest, uint32_t lenDest)
Computes and writes the thumbprint of pCert to pDest.
SOPC_ReturnStatus SOPC_KeyManager_SerializedCertificate_CreateFromDER(const uint8_t *der, uint32_t len, SOPC_SerializedCertificate **cert)
Creates a serialized certificate from a DER payload.
SecretBuffer (mangled key) and ExposedBuffer (contiguous deciphered buffered) APIs.
SOPC_ReturnStatus SOPC_KeyManager_AsymmetricKey_CreateFromFile(const char *szPath, SOPC_AsymmetricKey **ppKey, char *password, uint32_t lenPassword)
Creates an asymmetric key (usually a private key) from a file in the DER or PEM format.
A list of Certificate Revocation Lists.
Definition: key_manager_lib.h:82
A buffer of bytes with a maximum size, length and position.
void SOPC_KeyManager_Certificate_Free(SOPC_CertificateList *pCert)
Frees a Certificate created with SOPC_KeyManager_Certificate_CreateOrAddFromFile() or SOPC_KeyManager...
SOPC_ReturnStatus SOPC_KeyManager_CRL_CreateOrAddFromFile(const char *szPath, SOPC_CRLList **ppCRL)
Creates a new Certificate Revocation List (CRL) from a file in the DER or PEM format,...
SOPC_ReturnStatus
Definition: libs2opc_client.h:61