Verify that a pair of "internal" RSA private and public key strings are matched.
public static int KeyMatch( string privateKey, string publicKey )
Public Shared Function KeyMatch ( privateKey As String, publicKey As String ) As Integer
StringBuilder sbPublicKey = Rsa.ReadPublicKey(pubkeyFile); StringBuilder sbPrivateKey = Rsa.ReadPrivateKey(prikeyFile, "password"); int n = Rsa.KeyMatch(sbPrivateKey.ToString(), sbPublicKey.ToString()); Console.WriteLine("Rsa.KeyMatch returns {0} (expecting 0)", n); Debug.Assert(0 == n, "Rsa.KeyMatch failed.");
VB6/C equivalent: RSA_KeyMatch