Exemplo n.º 1
0
        public async Task SearchHttpKeyserverProtocol()
        {
            IOpenPgpKeySearch pgpKeys = new OpenPgpKeySearch();

            var email = "*****@*****.**";
            var key   = await pgpKeys.SearchHttpKeyServer(email);

            Assert.NotNull(key);

            Utils.CheckFingerprint(key, "4805b5106ca0eab809e16b798bfc4819e62f4977");
        }
Exemplo n.º 2
0
        public async Task SearchErrorTest()
        {
            IOpenPgpKeySearch pgpKeys = new OpenPgpKeySearch();

            await Assert.ThrowsAsync <FormatException>(() => pgpKeys.SearchWebKeyDirectory("notanaddress"));

            var inexistantEmail = "*****@*****.**";
            var inexistantKey   = await pgpKeys.SearchWebKeyDirectory(inexistantEmail);

            Assert.Null(inexistantKey);

            inexistantKey = await pgpKeys.SearchHttpKeyServer(inexistantEmail);

            Assert.Null(inexistantKey);
        }