GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
ASN1_TIME_PARSE(3) FreeBSD Library Functions Manual ASN1_TIME_PARSE(3)

ASN1_time_parse, ASN1_time_tm_cmp, ASN1_TIME_set_tm
LibreSSL utilities for ASN.1 time types

#include <openssl/asn1.h>

int
ASN1_time_parse(const char *bytes, size_t len, struct tm *tm, int mode);

int
ASN1_time_tm_cmp(struct tm *tm1, struct tm *tm2);

ASN1_TIME *
ASN1_TIME_set_tm(ASN1_TIME *s, struct tm *tm);

The ASN1_time_parse() function parses an ASN.1 time string of len bytes starting at bytes. The resulting time is stored in tm if tm is not NULL.

The mode parameter must be one of

  • 0 to parse a time as specified in RFC 5280 for an X509 object, which may be either a UTC time or a Generalized time.
  • to parse an RFC 5280 format UTC time.
  • to parse an RFC 5280 format Generalized time.

The ASN1_time_tm_cmp() function compares two times in tm1 and tm2.

The function ASN1_TIME_set_tm() sets the ASN1_TIME structure s to the time represented by the struct tm value pointed to by tm. If s is NULL, a new ASN1_TIME structure is allocated and returned.

ASN1_time_parse() returns
  • -1 if the string was invalid for the mode specified.
  • if the string parsed as a valid UTC time.
  • if the string parsed as a valid Generalized time.

ASN1_time_tm_cmp() returns

  • -1 if tm1 is less than tm2.
  • 1 if tm1 is greater than tm2.
  • 0 if tm1 is the same as tm2.

ASN1_TIME_set_tm() returns a pointer to an ASN1_TIME structure or NULL if an error occurred.

ASN1_TIME_new(3), ASN1_TIME_set(3), X509_cmp_time(3)

ASN1_time_parse() and ASN1_time_tm_cmp() first appeared in OpenBSD 6.1 and ASN1_TIME_set_tm() in OpenBSD 6.2.
November 2, 2020 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.