summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/ASN1_TIME_set.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man/ASN1_TIME_set.3')
-rw-r--r--src/lib/libcrypto/man/ASN1_TIME_set.344
1 files changed, 42 insertions, 2 deletions
diff --git a/src/lib/libcrypto/man/ASN1_TIME_set.3 b/src/lib/libcrypto/man/ASN1_TIME_set.3
index 4f6a99673a..3b649e05be 100644
--- a/src/lib/libcrypto/man/ASN1_TIME_set.3
+++ b/src/lib/libcrypto/man/ASN1_TIME_set.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ASN1_TIME_set.3,v 1.19 2022/11/13 22:11:44 schwarze Exp $ 1.\" $OpenBSD: ASN1_TIME_set.3,v 1.20 2023/11/13 12:46:07 beck Exp $
2.\" full merge up to: OpenSSL 3d0f1cb9 Jul 11 03:01:24 2017 +0800 2.\" full merge up to: OpenSSL 3d0f1cb9 Jul 11 03:01:24 2017 +0800
3.\" selective merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100 3.\" selective merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100
4.\" 4.\"
@@ -68,7 +68,7 @@
68.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 68.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
69.\" OF THE POSSIBILITY OF SUCH DAMAGE. 69.\" OF THE POSSIBILITY OF SUCH DAMAGE.
70.\" 70.\"
71.Dd $Mdocdate: November 13 2022 $ 71.Dd $Mdocdate: November 13 2023 $
72.Dt ASN1_TIME_SET 3 72.Dt ASN1_TIME_SET 3
73.Os 73.Os
74.Sh NAME 74.Sh NAME
@@ -95,6 +95,8 @@
95.Nm ASN1_UTCTIME_cmp_time_t , 95.Nm ASN1_UTCTIME_cmp_time_t ,
96.Nm ASN1_TIME_compare , 96.Nm ASN1_TIME_compare ,
97.Nm ASN1_TIME_to_generalizedtime 97.Nm ASN1_TIME_to_generalizedtime
98.Nm OPENSSL_gmtime,
99.Nm OPENSSL_timegm,
98.Nd ASN.1 Time functions 100.Nd ASN.1 Time functions
99.Sh SYNOPSIS 101.Sh SYNOPSIS
100.In openssl/asn1.h 102.In openssl/asn1.h
@@ -217,6 +219,16 @@
217.Fa "const ASN1_TIME *t" 219.Fa "const ASN1_TIME *t"
218.Fa "ASN1_GENERALIZEDTIME **out" 220.Fa "ASN1_GENERALIZEDTIME **out"
219.Fc 221.Fc
222.Ft struct tm *
223.Fo OPENSSL_gmtime
224.Fa "const time_t *time"
225.Fa "struct tm *out_tm"
226.Fc
227.Ft int
228.Fo OPENSSL_timegm
229.Fa "const struct tm *tm"
230.Fa "time_t *out_time"
231.Fc
220.Sh DESCRIPTION 232.Sh DESCRIPTION
221An 233An
222.Vt ASN1_TIME 234.Vt ASN1_TIME
@@ -562,6 +574,28 @@ is earlier than
562is later than 574is later than
563.Fa t , 575.Fa t ,
564or \-2 on error. 576or \-2 on error.
577.Pp
578.Fn OPENSSL_timegm
579converts a time structure in UTC time in
580.Fa tm
581to a time_t value in
582.Fa out_time
583.Fn OPENSSL_timegm
584returns 1 for success or 0 for failure.
585It can fail if the time is not representable in a time_t,
586or falls outside the range allowed in RFC 5280 times.
587.Pp
588.Fn OPENSSL_gmtime
589converts a time_t value in
590.Fa time
591to a struct tm in
592.Fa out_tm
593.Fn OPENSSL_gmtime
594returns
595.Fa out_tm
596on success or NULL for failure.
597It can fail if the time is not representable in a struct tm,
598or falls outside the range allowed in RFC 5280 times.
565.Sh EXAMPLES 599.Sh EXAMPLES
566Set a time object to one hour after the current time and print it 600Set a time object to one hour after the current time and print it
567out: 601out:
@@ -651,6 +685,12 @@ and
651.Fn ASN1_TIME_compare 685.Fn ASN1_TIME_compare
652first appeared in OpenSSL 1.1.1 and have been available since 686first appeared in OpenSSL 1.1.1 and have been available since
653.Ox 7.2 . 687.Ox 7.2 .
688.Pp
689.Fn OPENSSL_gmtime
690and
691.Fn OPENSSL_timegm
692first appeared in BoringSSL and have been available since
693.Ox 7.5 .
654.Sh CAVEATS 694.Sh CAVEATS
655Some applications add offset times directly to a 695Some applications add offset times directly to a
656.Vt time_t 696.Vt time_t