code: public static KeyChain configure(final Name name) throws SecurityException {
      PrivateKeyStorage keyStorage = new MemoryPrivateKeyStorage();
      IdentityStorage identityStorage = new MemoryIdentityStorage();
      KeyChain keyChain = new KeyChain(new IdentityManager(identityStorage, keyStorage),
              new SelfVerifyPolicyManager(identityStorage));
  
      // create keys, certs if necessary
      if (!identityStorage.doesIdentityExist(name)) {
        keyChain.createIdentityAndCertificate(name);
      }
  
      // set default identity
      keyChain.getIdentityManager().setDefaultIdentity(name);
  
      return keyChain;
    }
docs: Build and configure an in-memory {@link KeyChain}.
  
  @param name the name of the default identity to create
  @return an in-memory {@link KeyChain} configured with the name as the
  default identity
  @throws SecurityException if failed to create mock identity