1 | =pod
|
---|
2 |
|
---|
3 | =head1 NAME
|
---|
4 |
|
---|
5 | X509_cmp_time, X509_cmp_current_time, X509_time_adj, X509_time_adj_ex
|
---|
6 | - X509 time functions
|
---|
7 |
|
---|
8 | =head1 SYNOPSIS
|
---|
9 |
|
---|
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 | ASN1_TIME *X509_time_adj(ASN1_TIME *asn1_time, long offset_sec, time_t *in_tm);
|
---|
13 | ASN1_TIME *X509_time_adj_ex(ASN1_TIME *asn1_time, int offset_day, long
|
---|
14 | offset_sec, time_t *in_tm);
|
---|
15 |
|
---|
16 | =head1 DESCRIPTION
|
---|
17 |
|
---|
18 | X509_cmp_time() compares the ASN1_TIME in B<asn1_time> with the time
|
---|
19 | in <cmp_time>. X509_cmp_current_time() compares the ASN1_TIME in
|
---|
20 | B<asn1_time> with the current time, expressed as time_t. B<asn1_time>
|
---|
21 | must satisfy the ASN1_TIME format mandated by RFC 5280, i.e., its
|
---|
22 | format must be either YYMMDDHHMMSSZ or YYYYMMDDHHMMSSZ.
|
---|
23 |
|
---|
24 | X509_time_adj_ex() sets the ASN1_TIME structure B<asn1_time> to the time
|
---|
25 | B<offset_day> and B<offset_sec> after B<in_tm>.
|
---|
26 |
|
---|
27 | X509_time_adj() sets the ASN1_TIME structure B<asn1_time> to the time
|
---|
28 | B<offset_sec> after B<in_tm>. This method can only handle second
|
---|
29 | offsets up to the capacity of long, so the newer X509_time_adj_ex()
|
---|
30 | API should be preferred.
|
---|
31 |
|
---|
32 | In both methods, if B<asn1_time> is NULL, a new ASN1_TIME structure
|
---|
33 | is allocated and returned.
|
---|
34 |
|
---|
35 | In all methods, if B<in_tm> is NULL, the current time, expressed as
|
---|
36 | time_t, is used.
|
---|
37 |
|
---|
38 | =head1 BUGS
|
---|
39 |
|
---|
40 | Unlike many standard comparison functions, X509_cmp_time() and
|
---|
41 | X509_cmp_current_time() return 0 on error.
|
---|
42 |
|
---|
43 | =head1 RETURN VALUES
|
---|
44 |
|
---|
45 | X509_cmp_time() and X509_cmp_current_time() return -1 if B<asn1_time>
|
---|
46 | is earlier than, or equal to, B<cmp_time> (resp. current time), and 1
|
---|
47 | otherwise. These methods return 0 on error.
|
---|
48 |
|
---|
49 | X509_time_adj() and X509_time_adj_ex() return a pointer to the updated
|
---|
50 | ASN1_TIME structure, and NULL on error.
|
---|
51 |
|
---|
52 | =head1 COPYRIGHT
|
---|
53 |
|
---|
54 | Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
|
---|
55 |
|
---|
56 | Licensed under the OpenSSL license (the "License"). You may not use
|
---|
57 | this file except in compliance with the License. You can obtain a copy
|
---|
58 | in the file LICENSE in the source distribution or at
|
---|
59 | L<https://www.openssl.org/source/license.html>.
|
---|
60 |
|
---|
61 | =cut
|
---|