예제 #1
0
        public void VitaLink()
        {
            SignatureSecurityInformation result;
            FileStream file = new FileStream("msg/vitalink.cms", FileMode.Open);

            using (file)
            {
                result = bVerfier.Verify(file);
            }
            System.Console.WriteLine(result);

            Assert.AreEqual(ValidationStatus.Valid, result.ValidationStatus);
            Assert.AreEqual(TrustStatus.Full, result.TrustStatus);
        }
예제 #2
0
        //todo make it green
        private void Verify(Stream output)
        {
            IDataVerifier verifier = DataVerifierFactory.Create(level);

            SignatureSecurityInformation result = verifier.Verify(output);

            Console.WriteLine(result.ToString());

            Assert.AreEqual(validationStatus, result.ValidationStatus);
            Assert.AreEqual(trustStatus, result.TrustStatus);
            Assert.IsNull(result.Signer);
            Assert.IsNotNull(result.SignerId);
            Assert.AreEqual((level & Level.T_Level) == Level.T_Level, result.TimestampRenewalTime > DateTime.UtcNow);
            Assert.IsNotNull(result.SignatureValue);
            Assert.IsTrue((DateTime.UtcNow - result.SigningTime) < new TimeSpan(0, 1, 0));
            Assert.IsFalse(result.IsNonRepudiatable); //outer is never repudiatable
        }