예제 #1
0
        public void ReadPublicKeyFromPem()
        {
            RSA rsa = KeyReader.ReadPublicKey(PEM_PATH, null);

            Assert.IsNotNull(rsa);
            rsa.Dispose();
        }
예제 #2
0
        public void ReadPublicKeyFromPKCS12()
        {
            RSA rsa = KeyReader.ReadPublicKey(PFX_PATH, PFX_PASSWORD);

            Assert.IsNotNull(rsa);
            rsa.Dispose();
        }
예제 #3
0
        public void VerifyData()
        {
            RSA cert = KeyReader.ReadPublicKey(PEM_PATH, null);

            byte[] signature = SignData();

            Assert.IsTrue(cert.VerifyData(Encoding.Default.GetBytes(DATA), signature, HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1));

            cert.Dispose();
        }