diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2024-03-19 21:25:54 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2024-03-19 21:25:54 +0700 |
commit | bb54400cc05769baaf8ba5763224a9028b4fa964 (patch) | |
tree | 11acf3505b08494d198088b52ec9fd9c1c8b6807 /crypto/src | |
parent | Sanity checks and refactoring in Bcpg.Sig (diff) | |
download | BouncyCastle.NET-ed25519-bb54400cc05769baaf8ba5763224a9028b4fa964.tar.xz |
Refactor SignatureCreationTime
Diffstat (limited to 'crypto/src')
-rw-r--r-- | crypto/src/bcpg/sig/SignatureCreationTime.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/src/bcpg/sig/SignatureCreationTime.cs b/crypto/src/bcpg/sig/SignatureCreationTime.cs index 233dd18e6..87e41a43c 100644 --- a/crypto/src/bcpg/sig/SignatureCreationTime.cs +++ b/crypto/src/bcpg/sig/SignatureCreationTime.cs @@ -1,6 +1,5 @@ using System; -using Org.BouncyCastle.Crypto.Utilities; using Org.BouncyCastle.Utilities.Date; namespace Org.BouncyCastle.Bcpg.Sig @@ -11,10 +10,11 @@ namespace Org.BouncyCastle.Bcpg.Sig public class SignatureCreationTime : SignatureSubpacket { - protected static byte[] TimeToBytes(DateTime time) + [Obsolete("Will be removed")] + protected static byte[] TimeToBytes(DateTime time) { long t = DateTimeUtilities.DateTimeToUnixMs(time) / 1000L; - return Pack.UInt32_To_BE((uint)t); + return Utilities.TimeToBytes((uint)t); } public SignatureCreationTime(bool critical, bool isLongLength, byte[] data) @@ -29,7 +29,7 @@ namespace Org.BouncyCastle.Bcpg.Sig public DateTime GetTime() { - uint time = Pack.BE_To_UInt32(data, 0); + long time = Utilities.TimeFromBytes(data); return DateTimeUtilities.UnixMsToDateTime(time * 1000L); } } |