OpenBSD manual page server

Manual Page Search Parameters

X509_CMP_TIME(3) Library Functions Manual X509_CMP_TIME(3)

X509_cmp_time, X509_cmp_current_time, X509_time_adj_ex, X509_time_adjASN.1 Time utilities

#include <openssl/x509.h>

int
X509_cmp_time(const ASN1_TIME *asn1_time, time_t *cmp_time);

int
X509_cmp_current_time(const ASN1_TIME *asn1_time);

ASN1_TIME *
X509_time_adj_ex(ASN1_TIME *asn1_time, int offset_day, long offset_sec, time_t *in_tm);

ASN1_TIME *
X509_time_adj(ASN1_TIME *asn1_time, long offset_sec, time_t *in_tm);

() parses asn1_time with ASN1_time_parse(3) and compares it to cmp_time. () compares it to the current time.

() sets asn1_time to a time offset_day and offset_sec later than in_tm. () does the same with a 0 day offset. If asn1_time is NULL, a new ASN1_TIME structure is allocated and returned.

In all functions, if in_tm is NULL, the current time is used.

X509_cmp_time() and X509_cmp_current_time() return -1 if asn1_time is earlier than or equal to cmp_time, 1 if it is later, or 0 on error.

X509_time_adj_ex() and X509_time_adj() return a pointer to the updated ASN1_TIME structure or NULL on error.

ASN1_TIME_new(3), ASN1_time_parse(3), ASN1_TIME_set(3), time(3)

X509_cmp_current_time() first appeared in SSLeay 0.6.0 and has been available since OpenBSD 2.4.

X509_cmp_time() and X509_time_adj() first appeared in OpenSSL 0.9.6 and have been available since OpenBSD 2.9.

X509_time_adj_ex() first appeared in OpenSSL 1.0.0 and has been available since OpenBSD 4.9.

June 6, 2019 OpenBSD-current