<PackageReference Include="BouncyCastle.Cryptography" Version="2.7.0" />

Org.BouncyCastle.Asn1.Cms.BinaryTime

public sealed class BinaryTime : Asn1Encodable
RFC 6019BinaryTime type - the unsigned integer count of seconds since 1970-01-01T00:00:00Z (UTC).
public DerInteger Time { get; }

The encoded value as a count of seconds since the Unix epoch. May exceed long.MaxValue on a wildly out-of-range encoding; callers that only need a DateTime may prefer GetDateTime or TryGetDateTime, which reject unrepresentable values.

public BinaryTime(DateTime dateTime)

Construct a BinaryTime carrying the seconds-since-epoch of the supplied DateTime.

public BinaryTime(long seconds)

Construct a BinaryTime carrying the supplied count of seconds since 1970-01-01T00:00:00Z (UTC).

public BinaryTime(DerInteger time)

public static BinaryTime GetInstance(object obj)

public static BinaryTime GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit)

public static BinaryTime GetTagged(Asn1TaggedObject taggedObject, bool declaredExplicit)

Convert the encoded value to a DateTime.

public bool TryGetDateTime(out DateTime dateTime)

Convert the encoded value to a DateTime.