summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/ASN1_time_parse.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man/ASN1_time_parse.3')
-rw-r--r--src/lib/libcrypto/man/ASN1_time_parse.394
1 files changed, 94 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/ASN1_time_parse.3 b/src/lib/libcrypto/man/ASN1_time_parse.3
new file mode 100644
index 0000000000..e70a292f6d
--- /dev/null
+++ b/src/lib/libcrypto/man/ASN1_time_parse.3
@@ -0,0 +1,94 @@
1.\" $OpenBSD: ASN1_time_parse.3,v 1.1 2016/11/04 18:07:23 beck Exp $
2.\"
3.\" Copyright (c) 2016 Bob Beck <beck@@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: November 4 2016 $
18.Dt ASN1_TIME_PARSE 3
19.Os
20.Sh NAME
21.Nm ASN1_time_parse,
22.Nm ASN1_time_tm_cmp
23.Nd LibreSSL utilities for asn1 format time.
24.Sh SYNOPSIS
25.In asn1.h
26.Ft "int"
27.Fn ASN1_time_parse "const char *bytes" "size_t len" "struct tm *tm" "int mode
28.Ft "int"
29.Fn ASN1_time_tm_cmp "struct tm *tm1" "struct tm *tm2"
30.Sh DESCRIPTION
31The
32.Nm ASN1_time_parse
33function parses an asn1 time string of
34.Ar len
35bytes starting at
36.Ar bytes .
37The resulting time is stored in
38.Ar tm
39if
40.Ar tm
41is non NULL.
42.Pp
43The
44.Ar mode
45parameter must be one of
46.Bl -bullet -offset four
47.It
48.Ar 0
49to parse a time as specified in RFC 5280 for an X509 object,
50which may be either a UTC time or a Generalized time.
51.It
52.Ar V_ASN1_UTCTIME
53to parse an RFC 5280 format UTC time.
54.It
55.Ar V_ASN1_GENERALIZEDTIME
56to parse an RFC 5280 format Generalized time.
57.El
58.Pp
59The
60.Nm ASN1_time_tm_cmp
61function compares two times in
62.Ar tm1
63and
64.Ar tm2
65.Sh RETURN VALUES
66.Nm ASN1_parse_time
67returns
68.Bl -bullet -offset four
69.It
70.Ar -1
71if the string was invalid for the
72.Ar mode
73specified
74.It
75.Ar V_ASN1_UTCTIME
76if the string parsed as a valid UTC time.
77.It :
78.Ar V_ASN1_GENERALIZEDTIME
79if the string parsed as a valid Generalized time.
80.El
81.Pp
82.Nm ASN1_time_tm_cmp
83returns
84.Bl -bullet -offset four
85.It
86.Ar -1
87if tm1 is less than tm2.
88.It
89.Ar 1
90if tm1 is greater than tm2.
91.It
92.Ar 0
93if tm1 is the same as tm2.
94.El