Exemplo n.º 1
0
        public void AddPubKey(string Key)
        {
            byte[]       KeyBytes = ASCIIEncoding.ASCII.GetBytes(Key);
            MemoryStream key      = new MemoryStream(KeyBytes);

            tool.Import(key);
        }
Exemplo n.º 2
0
        public void TestImportKey()
        {
            Gpg g = new Gpg(GPG_BINARY_PATH);

            string testKey = "-----BEGIN PGP PUBLIC KEY BLOCK-----\r\n\r\nmQENBFqkNe4BCAC7rlgsdmfAAS8ieopmI4wqBO7YjgN5XspZUHX532eqWu7S7mAd\r\n1F43ES6zwS/9Z/t/tMX2iR6vKgfSGic2MI7sVvlCSGS7marOMeId6bngXPD1BQEe\r\n0WKHIYY5SwBWtqLRE2L3k+8w9K5SHHsDwbme5x4SneWz/4/bc2SMwyXsIb8EQn6R\r\nLsgt7w6Kk18Z1zWJG+bN3K1Es7jset2+cNhCfZnXSXhPyuzRoO3sNy7QQyYzsiKn\r\nTujfv4OsUMX/lyPPUPEUR03QjWA29lYpZUUZFYfvEV7s+ROA92LZ/chOKJUVgPG1\r\nYKuSEYFZUStAS4h17Q9bzwm37irZXh8Kemm/ABEBAAG0GUpvZSBUZXN0IDxqb2VA\r\nZG9tYWluLmNvbT6JAU4EEwEIADgWIQRQqHmapKYL4iMZN8sT8cK7WOeUCwUCWqQ1\r\n7gIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRAT8cK7WOeUCyppCACAKES5\r\nVGit762bnHT5AcgrcqgP+kflNnaw987B4ekrzt3aOCnrfKdVYj72oDx9GwRcd2GS\r\nqQTyU+dD1BeYF24gO5u0YEJkDdwQGruaXz62kGPSkN4jW+YQJqc1Ecp8iDMON6KI\r\nbxIRaOl3ZZhV23RCJY0jb4FOxqrsY3ytmWUss4wynpv6zkfNzzuQwv95OnDQVZn4\r\n84VmblLt7D82IGxvzgRBJ9o54f0AyqXkcJguup6eYhj6isS/9rDebwyfAtH1wFqX\r\nY8Cogm3kcn/y5haX9GfEI4dhuPFyw/6AviDSZQDr1/Xtpaw0xuVRqC7Pre07Rz8s\r\naYtqhGBynMrMPeceuQENBFqkNe4BCACyOqWFrEUG04Vuuh+KMVuKasrMkc/UcHgw\r\nmDhkDnvsA3OejEuoV+s17BGVv4eEJH3nYmaYqrWX1pHolGOjkeSUunxfIu00NAta\r\nu8sX3zVDIn2MJLT8h1ecof6Dvx1ceSdKGdAIbS5S0rX0tn2bnY9RzemBDCc92o7r\r\nyCRqgsTalflIT1TSoP96d3N0CgYvpLd4exSubYAXztGBTu8tozT7/SE8aYK/ao0A\r\nGG72BGPpnwRHNgiBDwFaScLO10hDoeL+fVPQFl/GFg49By9GnM2wTP6G6UqIfcFo\r\nIUTUvmNyxXoxu7Ex85fCCcOXMrWTj5Vyx6z3HHb+Z+MVXgQxXphhABEBAAGJATYE\r\nGAEIACAWIQRQqHmapKYL4iMZN8sT8cK7WOeUCwUCWqQ17gIbDAAKCRAT8cK7WOeU\r\nC+A2B/wLOJD45hyTsvUPR67/j46y/vNvT0oQuzzYGsoFsq5N6eCruHTZsv6eqgsH\r\nEeVHb8kjj437C1aFHN5/evO2fibNw7osHstFevj48YJ0n3TdYEklaSXIQMTpZbLD\r\nOcbvcmzC8r9D+2syCecgTRYcuCouJTJyQsI7JdAxeJInycKI5lvR4+O1SQFz9m/3\r\nyF9WqAtR0AXnoQjS2Y82lAKdaa52IIuiRUjJyP9YVRPTcH6LlyoRp5OXAQzreFGa\r\nP+CnwGYC2WV1hQ7qxpI2fAJ4/DquVgbuX85bLf+rbC7eP+4xti0tSRm9yVlB7qsY\r\nwcLNxOrwIKeLtws5Vmv5XNB7E3Fc\r\n=BllK\r\n-----END PGP PUBLIC KEY BLOCK-----\r\n";

            byte[]       testKeyBytes = System.Text.ASCIIEncoding.ASCII.GetBytes(testKey);
            MemoryStream key          = new MemoryStream(testKeyBytes);
            string       result       = g.Import(key);

            Debug.WriteLine(result);
        }
Exemplo n.º 3
0
        public void TestImportKey()
        {
            Gpg g = new Gpg(GPG_BINARY_PATH);

            string testKey = "-----BEGIN PGP PUBLIC KEY BLOCK-----\r\n Version: GnuPG v2\r\n \r\n mI0EV2gu1gEEALT6ouVbTBSk8KUKbOkhA2cWk3oVo9ZstcI7+io1+VPzaExkyPLm\r\n IQ6RTHLnjuN21mWRt0XdPM9KyULGa0Mnfdgrj73vI8KiMsjKppADCCrON/gP1v7f\r\n VhbbELCZ2qJvEXcBRt481ZhHLJLbbja5ogE2Bgy/XUrZCcL7OQGRHNYZABEBAAG0\r\n H1Rlc3QgSW1wb3J0IDxpbXBvcnRAZG9tYWluLmNvbT6IvwQTAQgAKQUCV2gu1gIb\r\n AwUJEswDAAcLCQgHAwIBBhUIAgkKCwQWAgMBAh4BAheAAAoJEB18VzOpLkfW6k4E\r\n AKdvv/4nCZ5lBUxpfoeq68sBMUJSdkJynmlpFngUjT0JdcAuby0nL7xULtLxsfZJ\r\n 1V7eTK0DT5QIj+zqn0Yhv+W+RwAn2U8UK6nPz8HcPmkH6NwVwRwZyunxUu86jh9l\r\n R3rmlZGa9FtB2aXxvHToJ0H4ODlnBLpuVKyg67Rj+NhouI0EV2gu1gEEAKik+LqK\r\n 8nac+wBQqMqvMGgREDmw+6bjhKcxfMDkCU+5fTi0hoqw6JTJ1UV1tQ7/5JvFZJbf\r\n Sl5fjZda1TvnaBdh/P5+9TJZw2NJb0PlTz9K0LqFvyVrlUq0OVxGXVAOIgAnUKHp\r\n e5UagUlied+mfbJTuPDmpxLoNTxFw/iHmrbDABEBAAGIpQQYAQgADwUCV2gu1gIb\r\n DAUJEswDAAAKCRAdfFczqS5H1lqbA/9pojoBFCUX/WHFDIczff1XQ0FDr9UVajuU\r\n mKsOKuLvv623nZCJolZgo1YUFPi5WMBwDdDdno8e2pH+ij5SX+Kb7u/jZ12D918S\r\n 8fQkWAGKWK+8/c9XZEP4YRTkcDKrG2ABqiW4rPbJPX+xOt2AiVetzavDlmLQivEJ\r\n KOF6pCI72g==\r\n =xvcI\r\n -----END PGP PUBLIC KEY BLOCK-----\r\n";

            byte[]       testKeyBytes = System.Text.ASCIIEncoding.ASCII.GetBytes(testKey);
            MemoryStream key          = new MemoryStream(testKeyBytes);
            string       result       = g.Import(key);

            Debug.WriteLine(result);
        }