This class is an IX509Selector implementation to select certificate pairs, which are e.g. used for cross certificates. The set of criteria is given from two X509CertStoreSelector objects, each of which, if present, must match the respective component of a pair.
상속: IX509Selector
 private X509CertPairStoreSelector(
     X509CertPairStoreSelector o)
 {
     this.certPair        = o.CertPair;
     this.forwardSelector = o.ForwardSelector;
     this.reverseSelector = o.ReverseSelector;
 }
		private X509CertPairStoreSelector(
			X509CertPairStoreSelector o)
		{
			this.certPair = o.CertPair;
			this.forwardSelector = o.ForwardSelector;
			this.reverseSelector = o.ReverseSelector;
		}
예제 #3
0
		private void certPairTest()
		{
			X509CertificateParser certParser = new X509CertificateParser();

			X509Certificate rootCert = certParser.ReadCertificate(CertPathTest.rootCertBin);
			X509Certificate interCert = certParser.ReadCertificate(CertPathTest.interCertBin);
			X509Certificate finalCert = certParser.ReadCertificate(CertPathTest.finalCertBin);

			// Testing CollectionCertStore generation from List
			X509CertificatePair pair1 = new X509CertificatePair(rootCert, interCert);

			IList certList = new ArrayList();
			certList.Add(pair1);
			certList.Add(new X509CertificatePair(interCert, finalCert));

			IX509Store certStore = X509StoreFactory.Create(
				"CertificatePair/Collection",
				new X509CollectionStoreParameters(certList));

			X509CertPairStoreSelector selector = new X509CertPairStoreSelector();
			X509CertStoreSelector fwSelector = new X509CertStoreSelector();

			fwSelector.SerialNumber = rootCert.SerialNumber;
			fwSelector.Subject = rootCert.IssuerDN;

			selector.ForwardSelector = fwSelector;

			IList col = new ArrayList(certStore.GetMatches(selector));

			if (col.Count != 1 || !col.Contains(pair1))
			{
				Fail("failed pair1 test");
			}

			col = new ArrayList(certStore.GetMatches(null));

			if (col.Count != 2)
			{
				Fail("failed null test");
			}
		}
예제 #4
0
 private X509CertPairStoreSelector(X509CertPairStoreSelector o)
 {
     certPair        = o.CertPair;
     forwardSelector = o.ForwardSelector;
     reverseSelector = o.ReverseSelector;
 }