Exemplo n.º 1
0
        public void testClearIdentities()
        {
            /* foreach */
            foreach (PibDataFixture2 fixture  in  pibImpls)
            {
                PibImpl pib = fixture.pib;

                pib.setTpmLocator("tpmLocator");

                // Add id, key, and cert.
                pib.addCertificate(fixture.id1Key1Cert1);
                Assert.AssertTrue(pib.hasIdentity(fixture.id1));
                Assert.AssertTrue(pib.hasKey(fixture.id1Key1Name));
                Assert.AssertTrue(pib.hasCertificate(fixture.id1Key1Cert1.getName()));

                // Clear identities.
                pib.clearIdentities();
                Assert.AssertEquals(0, pib.getIdentities().Count);
                Assert.AssertEquals(0, pib.getKeysOfIdentity(fixture.id1).Count);
                Assert.AssertEquals(0, pib.getCertificatesOfKey(fixture.id1Key1Name).Count);
                Assert.AssertEquals("tpmLocator", pib.getTpmLocator());
            }
        }