1 .\" $OpenBSD: ASN1_time_parse.3,v 1.7 2018/03/23 23:18:17 schwarze Exp $
3 .\" Copyright (c) 2016 Bob Beck <beck@openbsd.org>
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.
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.
17 .Dd $Mdocdate: March 23 2018 $
22 .Nm ASN1_time_tm_cmp ,
24 .Nd LibreSSL utilities for ASN.1 time types
28 .Fn ASN1_time_parse "const char *bytes" "size_t len" "struct tm *tm" "int mode"
30 .Fn ASN1_time_tm_cmp "struct tm *tm1" "struct tm *tm2"
32 .Fn ASN1_TIME_set_tm "ASN1_TIME *s" "struct tm *tm"
36 function parses an ASN.1 time string of
40 The resulting time is stored in
49 parameter must be one of
50 .Bl -bullet -offset four
52 0 to parse a time as specified in RFC 5280 for an X509 object,
53 which may be either a UTC time or a Generalized time.
56 to parse an RFC 5280 format UTC time.
58 .Dv V_ASN1_GENERALIZEDTIME
59 to parse an RFC 5280 format Generalized time.
64 function compares two times in
75 to the time represented by the
85 structure is allocated and returned.
89 .Bl -bullet -offset four
91 -1 if the string was invalid for the
96 if the string parsed as a valid UTC time.
98 .Dv V_ASN1_GENERALIZEDTIME
99 if the string parsed as a valid Generalized time.
104 .Bl -bullet -offset four
123 returns a pointer to an
127 if an error occurred.