public void ReadPublicKeyFromPem() { RSA rsa = KeyReader.ReadPublicKey(PEM_PATH, null); Assert.IsNotNull(rsa); rsa.Dispose(); }
public void ReadPublicKeyFromPKCS12() { RSA rsa = KeyReader.ReadPublicKey(PFX_PATH, PFX_PASSWORD); Assert.IsNotNull(rsa); rsa.Dispose(); }
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(); }