S2OPC OPCUA Toolkit
Loading...
Searching...
No Matches
sopc_pki_stack_lib_internal_itf.h File Reference

Defines the PKI interface functions used internally. More...

#include "sopc_pki_decl.h"

Go to the source code of this file.

Functions

SOPC_ReturnStatus SOPC_PKIProviderInternal_ValidateProfileAndCertificate (SOPC_PKIProvider *pPKI, const SOPC_CertificateList *pToValidate, const SOPC_PKI_Profile *pProfile, uint32_t *error)
 Validation function for a certificate with the PKI chain.
 
SOPC_ReturnStatus SOPC_PKIProviderInternal_SplitRootFromCertList (SOPC_CertificateList **ppCerts, SOPC_CertificateList **ppRootCa)
 Delete the roots CAs of the list ppCerts. Create a new list ppRootCa with all roots CA from ppCerts . If there is no root CA, the content of ppRootCa is set to NULL. If ppCerts becomes empty, its content is set to NULL.
 
void SOPC_PKIProviderInternal_GetListStats (SOPC_CertificateList *pCert, uint32_t *caCount, uint32_t *listLength, uint32_t *rootCount)
 Get some statistics about the pCert .
 

Detailed Description

Defines the PKI interface functions used internally.

Function Documentation

◆ SOPC_PKIProviderInternal_ValidateProfileAndCertificate()

SOPC_ReturnStatus SOPC_PKIProviderInternal_ValidateProfileAndCertificate ( SOPC_PKIProvider * pPKI,
const SOPC_CertificateList * pToValidate,
const SOPC_PKI_Profile * pProfile,
uint32_t * error )

Validation function for a certificate with the PKI chain.

It implements the validation with the certificate chain of the PKI.

Parameters
pPKIA valid pointer to the PKIProvider.
pToValidateA valid pointer to the Certificate to validate.
pProfileA valid pointer to the PKI profile.
[out]errorPointer to store the OpcUa error code when certificate validation failed.
Note
Default validation function used by PKIProvider when not created by SOPC_PKIPermissive_Create (without security)
Warning
In case of user PKI, the leaf profile part of pProfile is not applied to the certificate. The user leaf properties should be checked separately with SOPC_PKIProvider_CheckLeafCertificate .
Returns
SOPC_STATUS_OK when the certificate is successfully validated, and SOPC_STATUS_INVALID_PARAMETERS or SOPC_STATUS_NOK.

◆ SOPC_PKIProviderInternal_SplitRootFromCertList()

SOPC_ReturnStatus SOPC_PKIProviderInternal_SplitRootFromCertList ( SOPC_CertificateList ** ppCerts,
SOPC_CertificateList ** ppRootCa )

Delete the roots CAs of the list ppCerts. Create a new list ppRootCa with all roots CA from ppCerts . If there is no root CA, the content of ppRootCa is set to NULL. If ppCerts becomes empty, its content is set to NULL.

Parameters
ppCertsA valid pointer to the certificate list to delete the roots CA of.
ppRootCaA valid pointer to the new certificate list with the roots CA from ppCerts .
Returns
SOPC_STATUS_OK when successful.

◆ SOPC_PKIProviderInternal_GetListStats()

void SOPC_PKIProviderInternal_GetListStats ( SOPC_CertificateList * pCert,
uint32_t * caCount,
uint32_t * listLength,
uint32_t * rootCount )

Get some statistics about the pCert .

Parameters
pCertA valid pointer to the certificate list.
[out]caCountA valid pointer to store the number of certificate authorities.
[out]listLengthA valid pointer to store the length of the certificate list.
[out]rootCountA valid pointer to store the number of root CA (self-signed certificate authority).