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