7#ifndef BOTAN_ASN1_TIME_TYPE_H_
8#define BOTAN_ASN1_TIME_TYPE_H_
10#include <botan/asn1_obj.h>
42 explicit ASN1_Time(
const std::chrono::system_clock::time_point& time);
60 void set_to(std::string_view t_spec,
ASN1_Type type);
61 bool passes_sanity_check()
const;
67 uint32_t m_minute = 0;
68 uint32_t m_second = 0;
#define BOTAN_PUBLIC_API(maj, min)
#define BOTAN_FUTURE_EXPLICIT
uint64_t time_since_epoch() const
Return time since epoch.
std::chrono::system_clock::time_point to_std_timepoint() const
Returns a STL timepoint object.
void decode_from(BER_Decoder &from) override
static ASN1_Time from_seconds_since_epoch(uint64_t seconds)
Create an ASN1_Time from seconds since epoch.
std::string to_string() const
Return an internal string representation of the time.
ASN1_Time()=default
Create an invalid ASN1_Time.
bool time_is_set() const
Return if the time has been set somehow.
int32_t cmp(const ASN1_Time &other) const
Compare this time against another.
void encode_into(DER_Encoder &to) const override
DER encode a ASN1_Time.
std::string readable_string() const
Returns a human friendly string representation of no particular formatting.