add all
This commit is contained in:
37
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/tsp/GenTimeAccuracy.cs
vendored
Normal file
37
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/tsp/GenTimeAccuracy.cs
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.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");
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
Reference in New Issue
Block a user