WifiConfig_SetRootCACertStoreIdentifier function

Header: #include <applibs/wificonfig.h>

Sets the identifier of the stored certificate to use as the root certificate authority for a network. If the identifier is not set, the device will not authenticate the server that it connects to. The setting is effective immediately but will be lost across a reboot unless the WifiConfig_PersistConfig function is called after this function.

static int WifiConfig_SetRootCACertStoreIdentifier(int networkId, const char *certStoreIdentifier);

Parameters

  • networkId The ID of the network for which to set the certificate store identifier. WifiConfig_AddNetwork returns the network ID.

  • certStoreIdentifier A pointer to constant null-terminated character string that contains the name of the certificate. The name must be a unique string from one to CERTSTORE_MAX_IDENTIFIER_LENGTH characters in length. See CertStore_InstallRootCACertificate function for details.

Errors

Returns -1 if an error is encountered and sets errno to the error value.

  • EACCES: the application manifest doesn't include the EnterpriseWifiConfig capability.

  • EFAULT: the certStoreIdentifier parameter is NULL.

  • ERANGE: the length of the certStoreIdentifier parameter is greater than CERTSTORE_MAX_IDENTIFIER_LENGTH.

  • EAGAIN: the Wi-Fi device isn't ready.

  • ENETDOWN: the Wi-Fi network interface is unavailable.

  • EINVAL: the networkId parameter is invalid.

  • ENODEV: the networkId parameter doesn't match any of the IDs of the stored networks.

Any other errno may also be specified; such errors aren't deterministic and there's no guarantee that the same behavior will be retained through system updates.

Return value

Returns 0 for success, or -1 for failure, in which case errno is set to the error value.

Application manifest requirements

The application manifest must include the EnterpriseWifiConfig capability.