/// <summary>
        /// Create a Face using a the given KeyChain and certificate name.
        /// </summary>
        ///
        /// <param name="keyChain">The KeyChain. This calls keyChain.setFace with the created Face.</param>
        /// <param name="certificateName">The signing certificate name to use with keyChain.</param>
        /// <param name="hostname"></param>
        /// <returns>A Face configured with a valid signing key chain.</returns>
        /// <exception cref="System.Security.SecurityException"></exception>
        public static Face buildFaceWithKeyChain(String hostname,
				KeyChain keyChain, Name certificateName)
        {
            Face face = new Face(hostname);
            keyChain.setFace(face);
            face.setCommandSigningInfo(keyChain, certificateName);

            return face;
        }
        static void Main(string[] args)
        {
            var face = new Face
            (new TcpTransport(), new TcpTransport.ConnectionInfo("localhost"));

              // For now, when setting face.setCommandSigningInfo, use a key chain with
              //   a default private key instead of the system default key chain. This
              //   is OK for now because NFD is configured to skip verification, so it
              //   ignores the system default key chain.
              var identityStorage = new MemoryIdentityStorage();
              var privateKeyStorage = new MemoryPrivateKeyStorage();
              var keyChain = new KeyChain
            (new IdentityManager(identityStorage, privateKeyStorage),
              new SelfVerifyPolicyManager(identityStorage));
              keyChain.setFace(face);

              // Initialize the storage.
              var keyName = new Name("/testname/DSK-123");
              var certificateName = keyName.getSubName(0, keyName.size() - 1).append
            ("KEY").append(keyName.get(-1)).append("ID-CERT").append("0");
              identityStorage.addKey(keyName, KeyType.RSA, new Blob(DEFAULT_RSA_PUBLIC_KEY_DER));
              privateKeyStorage.setKeyPairForKeyName
            (keyName, KeyType.RSA, new ByteBuffer(DEFAULT_RSA_PUBLIC_KEY_DER),
              new ByteBuffer(DEFAULT_RSA_PRIVATE_KEY_DER));

              face.setCommandSigningInfo(keyChain, certificateName);

              var echo = new Echo(keyChain, certificateName);
              var prefix = new Name("/testecho");
              Console.Out.WriteLine("Register prefix  " + prefix.toUri());
              face.registerPrefix(prefix, echo, echo);

              // The main event loop.
              // Wait to receive one interest for the prefix.
              while (echo.responseCount_ < 1) {
            face.processEvents();

            // We need to sleep for a few milliseconds so we don't use 100% of
            //   the CPU.
            System.Threading.Thread.Sleep(5);
              }
        }