5 X509_cmp_time - X509 time functions
9 int X509_cmp_time(const ASN1_TIME *asn1_time, time_t *in_tm);
10 int X509_cmp_current_time(const ASN1_TIME *asn1_time);
11 ASN1_TIME *X509_time_adj(ASN1_TIME *asn1_time, long offset_sec, time_t *in_tm);
12 ASN1_TIME *X509_time_adj_ex(ASN1_TIME *asn1_time, int offset_day, long
13 offset_sec, time_t *in_tm);
17 X509_cmp_time() compares the ASN1_TIME in B<asn1_time> with the time
18 in <cmp_time>. X509_cmp_current_time() compares the ASN1_TIME in
19 B<asn1_time> with the current time, expressed as time_t. B<asn1_time>
20 must satisfy the ASN1_TIME format mandated by RFC 5280, i.e., its
21 format must be either YYMMDDHHMMSSZ or YYYYMMDDHHMMSSZ.
23 X509_time_adj_ex() sets the ASN1_TIME structure B<asn1_time> to the time
24 B<offset_day> and B<offset_sec> after B<in_tm>.
26 X509_time_adj() sets the ASN1_TIME structure B<asn1_time> to the time
27 B<offset_sec> after B<in_tm>. This method can only handle second
28 offsets up to the capacity of long, so the newer X509_time_adj_ex()
29 API should be preferred.
31 In both methods, if B<asn1_time> is NULL, a new ASN1_TIME structure
32 is allocated and returned.
34 In all methods, if B<in_tm> is NULL, the current time, expressed as
39 Unlike many standard comparison functions, X509_cmp_time() and
40 X509_cmp_current_time() return 0 on error.
44 X509_cmp_time() and X509_cmp_current_time() return -1 if B<asn1_time>
45 is earlier than, or equal to, B<cmp_time> (resp. current time), and 1
46 otherwise. These methods return 0 on error.
48 X509_time_ad() and X509_time_adj_ex() return a pointer to the updated
49 ASN1_TIME structure, and NULL on error.
53 Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
55 Licensed under the OpenSSL license (the "License"). You may not use
56 this file except in compliance with the License. You can obtain a copy
57 in the file LICENSE in the source distribution or at
58 L<https://www.openssl.org/source/license.html>.