Botan
2.1.0
Crypto and TLS for C++11
|
#include <asn1_time.h>
Public Member Functions | |
int32_t | cmp (const X509_Time &other) const |
Compare this time against another. More... | |
void | decode_from (BER_Decoder &) override |
void | encode_into (DER_Encoder &) const override |
DER encode a X509_Time. More... | |
std::string | readable_string () const |
Returns a human friendly string replesentation of no particular formatting. More... | |
bool | time_is_set () const |
Return if the time has been set somehow. More... | |
std::chrono::system_clock::time_point | to_std_timepoint () const |
Returns a STL timepoint object. More... | |
std::string | to_string () const |
Return an internal string representation of the time. More... | |
X509_Time ()=default | |
Create an invalid X509_Time. More... | |
X509_Time (const std::chrono::system_clock::time_point &time) | |
Create a X509_Time from a time point. More... | |
X509_Time (const std::string &t_spec, ASN1_Tag tag) | |
Create an X509_Time from string. More... | |
X.509 Time
Definition at line 19 of file asn1_time.h.
|
default |
Create an invalid X509_Time.
|
explicit |
Create a X509_Time from a time point.
Definition at line 20 of file asn1_time.cpp.
References Botan::calendar_value(), Botan::calendar_point::day, Botan::GENERALIZED_TIME, Botan::calendar_point::hour, Botan::calendar_point::minutes, Botan::calendar_point::month, Botan::calendar_point::seconds, Botan::UTC_TIME, and Botan::calendar_point::year.
Botan::X509_Time::X509_Time | ( | const std::string & | t_spec, |
ASN1_Tag | tag | ||
) |
Create an X509_Time from string.
Definition at line 34 of file asn1_time.cpp.
int32_t Botan::X509_Time::cmp | ( | const X509_Time & | other | ) | const |
Compare this time against another.
Definition at line 120 of file asn1_time.cpp.
References time_is_set().
Referenced by Botan::operator!=(), Botan::operator<(), Botan::operator<=(), Botan::operator==(), Botan::operator>(), and Botan::operator>=().
|
overridevirtual |
Decode whatever this object is from from
from | the BER_Decoder that will be read from |
Implements Botan::ASN1_Object.
Definition at line 50 of file asn1_time.cpp.
References Botan::BER_Decoder::get_next_object(), Botan::LATIN1_CHARSET, Botan::LOCAL_CHARSET, Botan::ASN1::to_string(), Botan::Charset::transcode(), and Botan::BER_Object::type_tag.
|
overridevirtual |
DER encode a X509_Time.
Implements Botan::ASN1_Object.
Definition at line 39 of file asn1_time.cpp.
References Botan::DER_Encoder::add_object(), Botan::GENERALIZED_TIME, Botan::LATIN1_CHARSET, Botan::LOCAL_CHARSET, to_string(), Botan::Charset::transcode(), Botan::UNIVERSAL, and Botan::UTC_TIME.
Referenced by Botan::Certificate_Store_In_SQL::revoke_cert().
std::string Botan::X509_Time::readable_string | ( | ) | const |
Returns a human friendly string replesentation of no particular formatting.
Definition at line 97 of file asn1_time.cpp.
References time_is_set().
Referenced by to_string().
bool Botan::X509_Time::time_is_set | ( | ) | const |
Return if the time has been set somehow.
Definition at line 115 of file asn1_time.cpp.
Referenced by cmp(), readable_string(), Botan::Certificate_Store_In_SQL::revoke_cert(), and to_string().
std::chrono::system_clock::time_point Botan::X509_Time::to_std_timepoint | ( | ) | const |
Returns a STL timepoint object.
Definition at line 253 of file asn1_time.cpp.
References Botan::calendar_point::to_std_timepoint().
std::string Botan::X509_Time::to_string | ( | ) | const |
Return an internal string representation of the time.
Definition at line 60 of file asn1_time.cpp.
References readable_string(), time_is_set(), Botan::ASN1::to_string(), and Botan::UTC_TIME.
Referenced by encode_into(), and Botan::X509_CRL::X509_CRL().