X509_cmp_time.pod 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. =pod
  2. =head1 NAME
  3. X509_cmp_time, X509_cmp_current_time, X509_time_adj, X509_time_adj_ex
  4. - X509 time functions
  5. =head1 SYNOPSIS
  6. int X509_cmp_time(const ASN1_TIME *asn1_time, time_t *in_tm);
  7. int X509_cmp_current_time(const ASN1_TIME *asn1_time);
  8. ASN1_TIME *X509_time_adj(ASN1_TIME *asn1_time, long offset_sec, time_t *in_tm);
  9. ASN1_TIME *X509_time_adj_ex(ASN1_TIME *asn1_time, int offset_day, long
  10. offset_sec, time_t *in_tm);
  11. =head1 DESCRIPTION
  12. X509_cmp_time() compares the ASN1_TIME in B<asn1_time> with the time
  13. in <cmp_time>. X509_cmp_current_time() compares the ASN1_TIME in
  14. B<asn1_time> with the current time, expressed as time_t. B<asn1_time>
  15. must satisfy the ASN1_TIME format mandated by RFC 5280, i.e., its
  16. format must be either YYMMDDHHMMSSZ or YYYYMMDDHHMMSSZ.
  17. X509_time_adj_ex() sets the ASN1_TIME structure B<asn1_time> to the time
  18. B<offset_day> and B<offset_sec> after B<in_tm>.
  19. X509_time_adj() sets the ASN1_TIME structure B<asn1_time> to the time
  20. B<offset_sec> after B<in_tm>. This method can only handle second
  21. offsets up to the capacity of long, so the newer X509_time_adj_ex()
  22. API should be preferred.
  23. In both methods, if B<asn1_time> is NULL, a new ASN1_TIME structure
  24. is allocated and returned.
  25. In all methods, if B<in_tm> is NULL, the current time, expressed as
  26. time_t, is used.
  27. =head1 BUGS
  28. Unlike many standard comparison functions, X509_cmp_time() and
  29. X509_cmp_current_time() return 0 on error.
  30. =head1 RETURN VALUES
  31. X509_cmp_time() and X509_cmp_current_time() return -1 if B<asn1_time>
  32. is earlier than, or equal to, B<cmp_time> (resp. current time), and 1
  33. otherwise. These methods return 0 on error.
  34. X509_time_ad() and X509_time_adj_ex() return a pointer to the updated
  35. ASN1_TIME structure, and NULL on error.
  36. =head1 COPYRIGHT
  37. Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
  38. Licensed under the OpenSSL license (the "License"). You may not use
  39. this file except in compliance with the License. You can obtain a copy
  40. in the file LICENSE in the source distribution or at
  41. L<https://www.openssl.org/source/license.html>.
  42. =cut