Beispiel #1
0
        public void Read_WithQualifier_ReturnsPolicyQualifierInfo()
        {
            var cpsUri = new DerIA5String("http://test.test");
            var bcPolicyQualifierInfo = new BcPolicyQualifierInfo(
                new DerObjectIdentifier(Oids.IdQtCps), cpsUri);
            var bytes = bcPolicyQualifierInfo.GetDerEncoded();

            var policyQualifierInfo = PolicyQualifierInfo.Read(bytes);

            Assert.Equal(Oids.IdQtCps, policyQualifierInfo.PolicyQualifierId.Value);
            Assert.Equal(cpsUri.GetDerEncoded(), policyQualifierInfo.Qualifier);
        }
        public void Read_WithAnyPolicyIdentifierAndIdQtCpsPolicyQualifier_ReturnsPolicyInformation()
        {
            var cpsUri = new DerIA5String("http://test.test");
            var bcPolicyInformation = new BcPolicyInformation(
                new DerObjectIdentifier(Oids.AnyPolicy),
                new DerSequence(new BcPolicyQualifierInfo(new DerObjectIdentifier(Oids.IdQtCps), cpsUri)));
            var bytes = bcPolicyInformation.GetDerEncoded();

            var policyInformation = PolicyInformation.Read(bytes);

            Assert.Equal(Oids.AnyPolicy, policyInformation.PolicyIdentifier.Value);
            Assert.Equal(1, policyInformation.PolicyQualifiers.Count);
            Assert.Equal(cpsUri.GetDerEncoded(), policyInformation.PolicyQualifiers[0].Qualifier);
        }