示例#1
0
        public void TestDSA()
        {
            var c = CryptographyFactory.CreateAsymmetric(CryptoAlgorithm.DSA);

            c.PublicKey  = c.GeneratePublicKey();
            c.PrivateKey = c.GeneratePrivateKey();

            var bytes = c.CreateSignature(Encoding.UTF8.GetBytes("fireasy"));

            Assert.IsTrue(c.VerifySignature(Encoding.UTF8.GetBytes("fireasy"), bytes));
        }