1X509_CMP_TIME(3ossl)                OpenSSL               X509_CMP_TIME(3ossl)
2
3
4

NAME

6       X509_cmp_time, X509_cmp_current_time, X509_cmp_timeframe,
7       X509_time_adj, X509_time_adj_ex, X509_gmtime_adj - X509 time functions
8

SYNOPSIS

10        int X509_cmp_time(const ASN1_TIME *asn1_time, time_t *in_tm);
11        int X509_cmp_current_time(const ASN1_TIME *asn1_time);
12        int X509_cmp_timeframe(const X509_VERIFY_PARAM *vpm,
13                               const ASN1_TIME *start, const ASN1_TIME *end);
14        ASN1_TIME *X509_time_adj(ASN1_TIME *asn1_time, long offset_sec, time_t *in_tm);
15        ASN1_TIME *X509_time_adj_ex(ASN1_TIME *asn1_time, int offset_day, long
16                                    offset_sec, time_t *in_tm);
17        ASN1_TIME *X509_gmtime_adj(ASN1_TIME *asn1_time, long offset_sec);
18

DESCRIPTION

20       X509_cmp_time() compares the ASN1_TIME in asn1_time with the time in
21       <in_tm>.
22
23       X509_cmp_current_time() compares the ASN1_TIME in asn1_time with the
24       current time, expressed as time_t.
25
26       X509_cmp_timeframe() compares the given time period with the reference
27       time included in the verification parameters vpm if they are not NULL
28       and contain X509_V_FLAG_USE_CHECK_TIME; else the current time is used
29       as reference time.
30
31       X509_time_adj_ex() sets the ASN1_TIME structure asn1_time to the time
32       offset_day and offset_sec after in_tm.
33
34       X509_time_adj() sets the ASN1_TIME structure asn1_time to the time
35       offset_sec after in_tm. This method can only handle second offsets up
36       to the capacity of long, so the newer X509_time_adj_ex() API should be
37       preferred.
38
39       In both methods, if asn1_time is NULL, a new ASN1_TIME structure is
40       allocated and returned.
41
42       In all methods, if in_tm is NULL, the current time, expressed as
43       time_t, is used.
44
45       asn1_time must satisfy the ASN1_TIME format mandated by RFC 5280, i.e.,
46       its format must be either YYMMDDHHMMSSZ or YYYYMMDDHHMMSSZ.
47
48       X509_gmtime_adj() sets the ASN1_TIME structure asn1_time to the time
49       offset_sec after the current time. It is equivalent to calling
50       X509_time_adj() with the last parameter as NULL.
51

BUGS

53       Unlike many standard comparison functions, X509_cmp_time() and
54       X509_cmp_current_time() return 0 on error.
55

RETURN VALUES

57       X509_cmp_time() and X509_cmp_current_time() return -1 if asn1_time is
58       earlier than, or equal to, in_tm (resp. current time), and 1 otherwise.
59       These methods return 0 on error.
60
61       X509_cmp_timeframe() returns 0 if vpm is not NULL and the verification
62       parameters do not contain X509_V_FLAG_USE_CHECK_TIME but do contain
63       X509_V_FLAG_NO_CHECK_TIME. Otherwise it returns 1 if the end time is
64       not NULL and the reference time (which has determined as stated above)
65       is past the end time, -1 if the start time is not NULL and the
66       reference time is before, else 0 to indicate that the reference time is
67       in range (implying that the end time is not before the start time if
68       both are present).
69
70       X509_time_adj(), X509_time_adj_ex() and X509_gmtime_adj() return a
71       pointer to the updated ASN1_TIME structure, and NULL on error.
72

HISTORY

74       X509_cmp_timeframe() was added in OpenSSL 3.0.
75
77       Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
78
79       Licensed under the Apache License 2.0 (the "License").  You may not use
80       this file except in compliance with the License.  You can obtain a copy
81       in the file LICENSE in the source distribution or at
82       <https://www.openssl.org/source/license.html>.
83
84
85
863.1.1                             2023-08-31              X509_CMP_TIME(3ossl)
Impressum