Checks if an RSA key is valid.
Public Declare Function RSA_CheckKey Lib "diCrPKI.dll"
(ByVal strKeyString As String,
ByVal nOptions As Long) As Long
nRet = RSA_CheckKey(strKeyString, nOptions)
long __stdcall RSA_CheckKey(const char *szKeyString, long nOptions);
If successful, the return value is PKI_VALID_PRIVATEKEY
(0)
if the key is a valid private key, or PKI_VALID_PUBLICKEY
(1) if the key is a public key;
otherwise it returns a negative error code.
Rsa.CheckKey Method (String)
Rsa.CheckKey Method (StringBuilder)
static bool dipki::Rsa::KeyIsPrivate (const std::string &keyStr)
static Rsa.key_isprivate(keystr)
If the key is a private key, the system carries out a pairwise check using a random message block to verify that the key is a valid RSA key pair (the format used to store private keys contains both the public and private components). Such a check cannot be carried out with a public key.
See RSA_FromXMLString
.
RSA_KeyBits RSA_KeyBytes RSA_KeyHashCode