29#ifndef SOPC_KEY_MANAGER_LIB_ITF_H_
30#define SOPC_KEY_MANAGER_LIB_ITF_H_
94 uint32_t lenPassword);
160 uint32_t* pLenWritten);
180 const bool bIsPublic,
181 const char* filePath,
183 const uint32_t pwdLen);
277 uint32_t* pLenAllocated);
356 char** ppApplicationUri,
357 size_t* pStringLength);
386 char** ppSubjectName,
387 uint32_t* pSubjectNameLen);
405 char*** ppDnsNameArray,
406 uint32_t* pArrayLength);
447 const char* pThumbprint,
506 uint32_t* pLenArray);
607 uint32_t* pLenArray);
644 const bool bIsServer,
648 uint32_t arrayLength,
668 uint32_t* pLenAllocated);
Defines the common declarations for the cryptographic objects. The structures and macros defined in t...
SOPC_SecretBuffer SOPC_SerializedAsymmetricKey
A serialized representation of an asymmetric key.
Definition sopc_crypto_decl.h:70
Defines the cryptographic abstraction interface for the object. A cryptographic implementation must d...
enum _SOPC_ReturnStatus SOPC_ReturnStatus
Common enumerations for S2OPC.
SOPC_ReturnStatus SOPC_KeyManager_Certificate_GetSanDnsNames(const SOPC_CertificateList *pCert, char ***ppDnsNameArray, uint32_t *pArrayLength)
Returns all the DNS names of certificate pCert as an array of C String.
SOPC_ReturnStatus SOPC_KeyManager_CRL_GetListLength(const SOPC_CRLList *pCrl, size_t *pLength)
Returns the number of chained CRL in pCrl list.
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_AsymmetricKey_GenRSA(uint32_t RSAKeySize, SOPC_AsymmetricKey **ppKey)
Generate an RSA asymmetric key.
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 SOPC_KeyManager_AsymmetricKey_ToPEMFile(SOPC_AsymmetricKey *pKey, const bool bIsPublic, const char *filePath, const char *pwd, const uint32_t pwdLen)
Write an asymmetric key to a PEM file.
SOPC_ReturnStatus SOPC_KeyManager_Certificate_GetListLength(const SOPC_CertificateList *pCert, size_t *pLength)
Return the number of chained certificates in the certificate list pCert.
bool SOPC_KeyManager_Certificate_CheckApplicationUri(const SOPC_CertificateList *pCert, const char *applicationUri)
Verify the application URI embedded in a certificate.
void SOPC_KeyManager_CSR_Free(SOPC_CSR *pCSR)
Frees a CSR created with SOPC_KeyManager_CSR_Create.
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...
SOPC_ReturnStatus SOPC_KeyManager_CertificateList_CheckCRL(SOPC_CertificateList *pCert, const SOPC_CRLList *pCRL, bool *bMatch)
Checks if each CA certificate from pCert have a revocation list available in pCRL.
SOPC_ReturnStatus SOPC_KeyManager_CSR_ToDER(SOPC_CSR *pCSR, SOPC_AsymmetricKey *pKey, uint8_t **ppDest, uint32_t *pLenAllocated)
Encodes CSR pCSR as a DER buffer and writes the result in ppDest.
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_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_Certificate_GetThumbprint(const SOPC_CryptoProvider *pProvider, const SOPC_CertificateList *pCert, uint8_t **ppDest, uint32_t *lenDest)
Computes and writes the thumbprint of pCert to pDest.
SOPC_ReturnStatus SOPC_KeyManager_CertificateList_RemoveCertFromSHA1(SOPC_CertificateList **ppCertList, SOPC_CRLList **ppCRLList, const char *pThumbprint, bool *pbMatch, bool *pbIsIssuer)
Remove a single Certificate from its thumbprint. If the Certificate is a CA Certificate then all the ...
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.
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_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.
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_CRL_Copy(const SOPC_CRLList *pCrl, SOPC_CRLList **ppCrlCopy)
Makes a copy of a given CRL list.
SOPC_ReturnStatus SOPC_KeyManager_CertificateList_AttachToSerializedArray(const SOPC_CertificateList *pCerts, SOPC_SerializedCertificate **pSerializedArray, uint32_t *pLenArray)
Attach a DER certificate list to a serialized certificate array.
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...
SOPC_ReturnStatus SOPC_KeyManager_Certificate_GetSubjectName(const SOPC_CertificateList *pCert, char **ppSubjectName, uint32_t *pSubjectNameLen)
Returns the subject name of certificate pCert as a C String.
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_Copy(const SOPC_CertificateList *pCert, SOPC_CertificateList **ppCertCopy)
Makes a copy of a given certificate list.
void SOPC_KeyManager_Certificate_Free(SOPC_CertificateList *pCert)
Frees a Certificate created with SOPC_KeyManager_Certificate_CreateOrAddFromFile or SOPC_KeyManager_C...
SOPC_ReturnStatus SOPC_KeyManager_CRL_ToDER_Files(SOPC_CRLList *pCrls, const char *directoryPath)
Write all the CRL ( pCrls ) in DER files. at destination directoryPath . File names are defined using...
SOPC_ReturnStatus SOPC_KeyManager_CRLList_AttachToSerializedArray(const SOPC_CRLList *pCRLs, SOPC_SerializedCRL **pSerializedArray, uint32_t *pLenArray)
Attach a DER CRL list to a serialized CRL array.
void SOPC_KeyManager_CRL_Free(SOPC_CRLList *pCRL)
Frees a Certificate created with SOPC_KeyManager_CRL_CreateOrAddFromFile or SOPC_KeyManager_CRL_Creat...
SOPC_ReturnStatus SOPC_KeyManager_Certificate_ToDER_Files(SOPC_CertificateList *pCerts, const char *directoryPath)
Write all the certificates of pCerts in DER files at destination directoryPath . File names are defin...
SOPC_ReturnStatus SOPC_KeyManager_Certificate_IsSelfSigned(const SOPC_CertificateList *pCert, bool *pbIsSelfSigned)
Whether the first item of a certificate list is self signed.
void SOPC_KeyManager_AsymmetricKey_Free(SOPC_AsymmetricKey *pKey)
Frees a previously created asymmetric key created with SOPC_KeyManager_AsymmetricKey_CreateFromBuffer...
SOPC_ReturnStatus SOPC_KeyManager_CSR_Create(const char *subjectName, const bool bIsServer, const char *mdType, const char *uri, char **pDnsArray, uint32_t arrayLength, SOPC_CSR **ppCSR)
Create a certificate signing request signed with pKey.
char * SOPC_KeyManager_Certificate_GetCstring_SHA1(const SOPC_CertificateList *pCert)
Returns the SHA-1 thumbprint of a certificate.
SOPC_ReturnStatus SOPC_KeyManager_Certificate_GetMaybeApplicationUri(const SOPC_CertificateList *pCert, char **ppApplicationUri, size_t *pStringLength)
Copy the application URI embedded in a certificate.
The asymmetric key representation.
Definition key_manager_cyclone.h:42
Bytes buffer structure.
Definition sopc_buffer.h:38
A list of Certificate Revocation Lists.
Definition key_manager_cyclone.h:79
Definition key_manager_cyclone.h:86
The signed public key representation.
Definition key_manager_cyclone.h:60
The SOPC_CryptoProvider context.
Definition sopc_crypto_provider.h:43