Computes the hash code of an "internal" RSA public or private key string.
Public Declare Function RSA_KeyHashCode Lib "diCrPKI.dll"
(ByVal strKey As String) As Long
nRet = RSA_KeyHashCode(strKey)
long __stdcall RSA_KeyHashCode(const char *szKeyString);
A 32-bit hash code for the key, or zero on error.
Rsa.KeyHashCode Method (String)
Rsa.KeyHashCode Method (StringBuilder)
static uint32_t dipki::Rsa::KeyHashCode (const std::string &intKeyString)
static Rsa.key_hashcode(keystr)
Use this function to compare internal key strings. As of version 3.0, internal key strings are encrypted
and cannot be compared directly.
The actual string values may or may not be the same even though the underlying key is.
The hash code value will be the same for a given key.
The hash code is computed to an internal algorithm and may return any integer value
between -2,147,483,648 and 2,147,483,647.
If the key string is invalid, the return value is zero and a nonzero error code will be set (use PKI_ErrorCode
to check).
There is a very small chance (one in 4 billion) that a valid key string returns a hash code of zero.
See the example in RSA_ReadPrivateKeyInfo
.