CryptoSys PKI Pro Manual

RSA_KeyHashCode

Computes the hash code of an "internal" RSA public or private key string.

VBA/VB6 Syntax

Public Declare Function RSA_KeyHashCode Lib "diCrPKI.dll" (ByVal strKey As String) As Long

nRet = RSA_KeyHashCode(strKey)

C/C++ Syntax

long __stdcall RSA_KeyHashCode(const char *szKeyString);

Parameters

szKeyString
[in] containing the RSA private or public key string in internal format.

Returns (VBA/C)

A 32-bit hash code for the key, or zero on error.

.NET Equivalent

Rsa.KeyHashCode Method (String)
Rsa.KeyHashCode Method (StringBuilder)

C++ (STL) Equivalent

static uint32_t dipki::Rsa::KeyHashCode (const std::string &intKeyString)

Python Equivalent

static Rsa.key_hashcode(keystr)

Remarks

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.

Example

See the example in RSA_ReadPrivateKeyInfo.

See Also

RSA_KeyBits RSA_KeyBytes

[Contents] [Index]

[PREV: RSA_KeyBytes...]   [Contents]   [Index]   
   [NEXT: RSA_KeyMatch...]

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.