Major refactoring (simplification and improvements)
The new implementation largely mimics the implementation in ndn-cxx
Change-Id: Ia7128e9cbdb302ebb3d50fa261fdc1dd3fd0116a
diff --git a/src/main/java/com/intel/jndn/mock/MockKeyChain.java b/src/main/java/com/intel/jndn/mock/MockKeyChain.java
index 2ac92cf..87b82ec 100644
--- a/src/main/java/com/intel/jndn/mock/MockKeyChain.java
+++ b/src/main/java/com/intel/jndn/mock/MockKeyChain.java
@@ -37,7 +37,6 @@
* @throws net.named_data.jndn.security.SecurityException
*/
public static KeyChain configure(Name name) throws net.named_data.jndn.security.SecurityException {
- // access key chain in ~/.ndn; create if necessary
PrivateKeyStorage keyStorage = new MemoryPrivateKeyStorage();
IdentityStorage identityStorage = new MemoryIdentityStorage();
KeyChain keyChain = new KeyChain(new IdentityManager(identityStorage, keyStorage),
@@ -45,8 +44,7 @@
// create keys, certs if necessary
if (!identityStorage.doesIdentityExist(name)) {
- Name keyName = keyChain.createIdentity(name);
- keyChain.setDefaultKeyForIdentity(keyName, name);
+ keyChain.createIdentityAndCertificate(name);
}
// set default identity