diff options
author | Oren Novotny <oren@novotny.org> | 2014-08-27 21:54:42 -0400 |
---|---|---|
committer | Oren Novotny <oren@novotny.org> | 2014-08-27 21:54:42 -0400 |
commit | fafcc5120591e9b549dc8d85d7afc50842a067a7 (patch) | |
tree | fe99faca65ead75b67634d169fbfcac5a965f5d5 /crypto/src/asn1 | |
parent | Fix bugs from tests (diff) | |
download | BouncyCastle.NET-ed25519-fafcc5120591e9b549dc8d85d7afc50842a067a7.tar.xz |
Fix bugs based on tests.
Diffstat (limited to 'crypto/src/asn1')
-rw-r--r-- | crypto/src/asn1/DerGeneralizedTime.cs | 2 | ||||
-rw-r--r-- | crypto/src/asn1/DerUTCTime.cs | 2 | ||||
-rw-r--r-- | crypto/src/asn1/x509/Time.cs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/crypto/src/asn1/DerGeneralizedTime.cs b/crypto/src/asn1/DerGeneralizedTime.cs index 9a125ff3b..ceb1a4fa3 100644 --- a/crypto/src/asn1/DerGeneralizedTime.cs +++ b/crypto/src/asn1/DerGeneralizedTime.cs @@ -83,7 +83,7 @@ namespace Org.BouncyCastle.Asn1 public DerGeneralizedTime( DateTime time) { - this.time = time.ToString(@"yyyyMMddHHmmss\Z"); + this.time = time.ToUniversalTime().ToString(@"yyyyMMddHHmmss\Z"); } internal DerGeneralizedTime( diff --git a/crypto/src/asn1/DerUTCTime.cs b/crypto/src/asn1/DerUTCTime.cs index 56fabeb47..812d91db6 100644 --- a/crypto/src/asn1/DerUTCTime.cs +++ b/crypto/src/asn1/DerUTCTime.cs @@ -86,7 +86,7 @@ namespace Org.BouncyCastle.Asn1 public DerUtcTime( DateTime time) { - this.time = time.ToString("yyMMddHHmmss") + "Z"; + this.time = time.ToUniversalTime().ToString("yyMMddHHmmss") + "Z"; } internal DerUtcTime( diff --git a/crypto/src/asn1/x509/Time.cs b/crypto/src/asn1/x509/Time.cs index 0f2511e6d..04b4a5a65 100644 --- a/crypto/src/asn1/x509/Time.cs +++ b/crypto/src/asn1/x509/Time.cs @@ -36,7 +36,7 @@ namespace Org.BouncyCastle.Asn1.X509 public Time( DateTime date) { - string d = date.ToString("yyyyMMddHHmmss") + "Z"; + string d = date.ToUniversalTime().ToString("yyyyMMddHHmmss") + "Z"; int year = Int32.Parse(d.Substring(0, 4)); |