Exemplo n.º 1
0
        public void TestClearSignedBogusInput()
        {
            CreateTestFile(clearSignedPublicKey, "test.txt");

            RsaKeyRingGenerator.Main(new string[] { "test", "password" });

            ClearSignedFileProcessor.Main(new string[] { "-s", "test.txt", "secret.bpg", "password" });
        }
Exemplo n.º 2
0
        public void TestClearSignedSingleLine()
        {
            CreateTestData("This is a test payload!" + Environment.NewLine, "test.txt");
            CreateTestData("This is a test payload!" + Environment.NewLine, "test.bak");

            RsaKeyRingGenerator.Main(new string[] { "test", "password" });

            ClearSignedFileProcessor.Main(new string[] { "-s", "test.txt", "secret.bpg", "password" });
            ClearSignedFileProcessor.Main(new string[] { "-v", "test.txt.asc", "pub.bpg" });

            CompareFile("test.bak", "test.txt");
        }
Exemplo n.º 3
0
        public void TestRsaKeyGeneration()
        {
            RsaKeyRingGenerator.Main(new string[] { "test", "password" });

            CreateSmallTestInput();
            CreateLargeTestInput();

            CheckSigning("bpg");
            CheckKeyBasedEncryption("bpg");
            CheckLargeKeyBasedEncryption("bpg");

            RsaKeyRingGenerator.Main(new string[] { "-a", "test", "password" });

            CheckSigning("asc");
            CheckKeyBasedEncryption("asc");
            CheckLargeKeyBasedEncryption("asc");
        }
Exemplo n.º 4
0
        public void TestClearSigned()
        {
            CreateTestFile(clearSignedPublicKey, "pub.bpg");

            CheckClearSignedVerify(nlOnlySignedMessage);
            CheckClearSignedVerify(crOnlySignedMessage);
            CheckClearSignedVerify(crNlSignedMessage);
            CheckClearSignedVerify(crNlSignedMessageTrailingWhiteSpace);

            ClearSignedFileProcessor.Main(new string[] { "-v", "test.txt.asc", "pub.bpg" });

            RsaKeyRingGenerator.Main(new string[] { "test", "password" });

            CheckClearSigned(crOnlyMessage);
            CheckClearSigned(nlOnlyMessage);
            CheckClearSigned(crNlMessage);
            CheckClearSigned(crNlMessageTrailingWhiteSpace);
        }