コード例 #1
0
ファイル: TimeTest.cs プロジェクト: 894880010/MP
        public void CheckCmsTimeVsX509Time()
        {
            DateTime now = DateTime.UtcNow;

            // Time classes only have a resolution of seconds
            now = SimpleTest.MakeUtcDateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second);

            Org.BouncyCastle.Asn1.Cms.Time  cmsTime  = new Org.BouncyCastle.Asn1.Cms.Time(now);
            Org.BouncyCastle.Asn1.X509.Time x509Time = new Org.BouncyCastle.Asn1.X509.Time(now);

//			Assert.AreEqual(cmsTime.Date, x509Time.ToDateTime());
            Assert.AreEqual(now, cmsTime.Date);
            Assert.AreEqual(now, x509Time.ToDateTime());
        }
コード例 #2
0
ファイル: TimeTest.cs プロジェクト: KimikoMuffin/bc-csharp
		public void CheckCmsTimeVsX509Time()
		{
			DateTime now = DateTime.UtcNow;

			// Time classes only have a resolution of seconds
			now = SimpleTest.MakeUtcDateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second);

            Org.BouncyCastle.Asn1.Cms.Time cmsTime = new Org.BouncyCastle.Asn1.Cms.Time(now);
			Org.BouncyCastle.Asn1.X509.Time x509Time = new Org.BouncyCastle.Asn1.X509.Time(now);

//			Assert.AreEqual(cmsTime.Date, x509Time.ToDateTime());
			Assert.AreEqual(now, cmsTime.Date);
			Assert.AreEqual(now, x509Time.ToDateTime());
		}