How can I import an RSA public key from either XML or modulus/exponent in native code for use with Windows CAPI's CryptVerifySignature?
问题 In C#, I am able to validate a hash against a public key in either of the following ways: // Import from raw modulus and exponent using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider()) { RSAParameters rsaKeyInfo = new RSAParameters {Modulus = modulus, Exponent = exponent}; rsa.ImportParameters(rsaKeyInfo); return rsa.VerifyHash(hash, CryptoConfig.MapNameToOID("SHA512"), signature); } // Import from XML using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider()) { rsa