public void setUp()
        {
            FileInfo policyConfigDirectory = net.named_data.jndn.tests.integration_tests.IntegrationTestsCommon
                    .getPolicyConfigDirectory();

            databaseFilePath = new FileInfo(System.IO.Path.Combine(policyConfigDirectory.FullName,"test.db"));
            databaseFilePath.delete();
        }
        public void setUp()
        {
            // Don't show INFO log messages.
            ILOG.J2CsMapping.Util.Logging.Logger.getLogger("").setLevel(ILOG.J2CsMapping.Util.Logging.Level.WARNING);

            FileInfo policyConfigDirectory = net.named_data.jndn.tests.integration_tests.IntegrationTestsCommon
                    .getPolicyConfigDirectory();

            databaseFilePath = new FileInfo(System.IO.Path.Combine(policyConfigDirectory.FullName,"test-public-info.db"));
            databaseFilePath.delete();

            identityStorage = new BasicIdentityStorage(System.IO.Path.GetFullPath(databaseFilePath.Name));
            identityManager = new IdentityManager(identityStorage,
                    new FilePrivateKeyStorage());
            policyManager = new SelfVerifyPolicyManager(identityStorage);
            keyChain = new KeyChain(identityManager, policyManager);
        }
        public void setUp()
        {
            // Don't show INFO log messages.
            ILOG.J2CsMapping.Util.Logging.Logger.getLogger("").setLevel(ILOG.J2CsMapping.Util.Logging.Level.WARNING);

            FileInfo policyConfigDirectory = net.named_data.jndn.tests.integration_tests.IntegrationTestsCommon
                    .getPolicyConfigDirectory();

            databaseFilePath = new FileInfo(System.IO.Path.Combine(policyConfigDirectory.FullName,"test.db"));
            databaseFilePath.delete();

            database = new Sqlite3GroupManagerDb(System.IO.Path.GetFullPath(databaseFilePath.Name));
        }
        public void setUp()
        {
            // Don't show INFO log messages.
            ILOG.J2CsMapping.Util.Logging.Logger.getLogger("").setLevel(ILOG.J2CsMapping.Util.Logging.Level.WARNING);

            FileInfo policyConfigDirectory = net.named_data.jndn.tests.integration_tests.IntegrationTestsCommon
                    .getPolicyConfigDirectory();

            dKeyDatabaseFilePath = new FileInfo(System.IO.Path.Combine(policyConfigDirectory.FullName,"manager-d-key-test.db"));
            dKeyDatabaseFilePath.delete();

            eKeyDatabaseFilePath = new FileInfo(System.IO.Path.Combine(policyConfigDirectory.FullName,"manager-e-key-test.db"));
            eKeyDatabaseFilePath.delete();

            intervalDatabaseFilePath = new FileInfo(System.IO.Path.Combine(policyConfigDirectory.FullName,"manager-interval-test.db"));
            intervalDatabaseFilePath.delete();

            groupKeyDatabaseFilePath = new FileInfo(System.IO.Path.Combine(policyConfigDirectory.FullName,"manager-group-key-test.db"));
            groupKeyDatabaseFilePath.delete();

            RsaKeyParams paras = new RsaKeyParams();
            DecryptKey memberDecryptKey = net.named_data.jndn.encrypt.algo.RsaAlgorithm.generateKey(paras);
            decryptKeyBlob = memberDecryptKey.getKeyBits();
            EncryptKey memberEncryptKey = net.named_data.jndn.encrypt.algo.RsaAlgorithm
                    .deriveEncryptKey(decryptKeyBlob);
            encryptKeyBlob = memberEncryptKey.getKeyBits();

            // Generate the certificate.
            certificate.setName(new Name("/ndn/memberA/KEY/ksk-123/ID-CERT/123"));
            PublicKey contentPublicKey = new PublicKey(encryptKeyBlob);
            certificate.setPublicKeyInfo(contentPublicKey);
            certificate.encode();

            Blob signatureInfoBlob = new Blob(SIG_INFO, false);
            Blob signatureValueBlob = new Blob(SIG_VALUE, false);

            Signature signature = net.named_data.jndn.encoding.TlvWireFormat.get().decodeSignatureInfoAndValue(
                    signatureInfoBlob.buf(), signatureValueBlob.buf());
            certificate.setSignature(signature);

            certificate.wireEncode();

            // Set up the keyChain.
            MemoryIdentityStorage identityStorage = new MemoryIdentityStorage();
            MemoryPrivateKeyStorage privateKeyStorage = new MemoryPrivateKeyStorage();
            keyChain = new KeyChain(new IdentityManager(identityStorage,
                    privateKeyStorage), new NoVerifyPolicyManager());
            Name identityName = new Name("TestGroupManager");
            keyChain.createIdentityAndCertificate(identityName);
            keyChain.getIdentityManager().setDefaultIdentity(identityName);

            net.named_data.jndn.encrypt.GroupManager.setFriendAccess(this);
        }