CertStore_GetCertificateNotAfter function

Header: #include <applibs/certstore.h>

Gets the NotAfter field from a certificate. This field specifies the date and time at which the certificate can no longer be used for validation.

static int CertStore_GetCertificateNotAfter(const char *identifier, struct tm *outNotAfter);

Parameters

  • identifier The ID of the certificate.

  • outNotAfter A pointer to a tm structure to receive the Not After time. The tm_wday, tm_yday, and tm_isdst fields in the structure will be undefined.

Errors

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

  • EACCES: the operation isn't allowed because the CertStore capability isn't set in the application manifest.

  • EAGAIN: the OS certstore component isn't ready yet.

  • EFAULT: the identifier is NULL.

  • EINVAL: the identifier parameter specifies an invalid or corrupted certificate.

  • ENOENT: the identifier certificate cannot be found.

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 CertStore capability.