MCPcopy Create free account
hub / github.com/Icinga/icinga2 / MakeASN1TimeFrom

Function MakeASN1TimeFrom

test/base-tlsutility.cpp:97–101  ·  view source on GitHub ↗

* Creates an ASN1_TIME object representing the current time plus the specified number of seconds. * * @param seconds The number of seconds to add to the current time. * @returns A shared pointer to the ASN1_TIME object. */

Source from the content-addressed store, hash-verified

95 * @returns A shared pointer to the ASN1_TIME object.
96 */
97static std::shared_ptr<ASN1_TIME> MakeASN1TimeFrom(long seconds)
98{
99 auto now = time(nullptr);
100 return {X509_time_adj_ex(nullptr, 0, seconds, &now), ASN1_TIME_free};
101}
102
103/**
104 * Formats an ASN1_TIME object as a human-readable string.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected