You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
715 B
33 lines
715 B
using Org.BouncyCastle.Asn1;
|
|
using Org.BouncyCastle.Asn1.Tsp;
|
|
|
|
namespace Org.BouncyCastle.Tsp
|
|
{
|
|
public class GenTimeAccuracy
|
|
{
|
|
private Accuracy accuracy;
|
|
|
|
public GenTimeAccuracy(
|
|
Accuracy accuracy)
|
|
{
|
|
this.accuracy = accuracy;
|
|
}
|
|
|
|
public int Seconds { get { return GetTimeComponent(accuracy.Seconds); } }
|
|
|
|
public int Millis { get { return GetTimeComponent(accuracy.Millis); } }
|
|
|
|
public int Micros { get { return GetTimeComponent(accuracy.Micros); } }
|
|
|
|
private int GetTimeComponent(
|
|
DerInteger time)
|
|
{
|
|
return time == null ? 0 : time.IntValueExact;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return Seconds + "." + Millis.ToString("000") + Micros.ToString("000");
|
|
}
|
|
}
|
|
}
|
|
|