コード例 #1
0
        public void TestRemovePublicKeyInterface()
        {
            var client = new KeysmithClient("http://localhost:8080");

            Assert.IsNull(client.RemovePublicKey("test"));
            Assert.IsNull(client.RemovePublicKey(string.Empty));
            Assert.IsNull(client.RemovePublicKey(null));
        }
コード例 #2
0
        public void TestPostPublicKeyInterface()
        {
            var       client    = new KeysmithClient("http://localhost:8080");
            var       keyMaster = new KeyMaster();
            PublicKey pk        = keyMaster.GenerateKeyPair().PublicKey;

            Assert.IsNotNull(client.PostPublicKey(pk));
            Assert.IsNull(client.PostPublicKey(null));
        }
コード例 #3
0
        public void TestUpdatePublicKeyInterface()
        {
            var       client    = new KeysmithClient("http://localhost:8080");
            var       keyMaster = new KeyMaster();
            PublicKey pk        = keyMaster.GenerateKeyPair().PublicKey;

            Assert.IsNull(client.UpdatePublicKey("test", pk));
            client.UpdatePublicKey(string.Empty, pk);
            client.UpdatePublicKey(null, pk);
            Assert.IsNull(client.UpdatePublicKey("test", null));
            Assert.IsNull(client.UpdatePublicKey(string.Empty, null));
            Assert.IsNull(client.UpdatePublicKey(null, null));
        }