CryptoSys PKI Pro Manual

RSA_CheckKey

Checks if an RSA key is valid.

VBA/VB6 Syntax

Public Declare Function RSA_CheckKey Lib "diCrPKI.dll" (ByVal strKeyString As String, ByVal nOptions As Long) As Long

nRet = RSA_CheckKey(strKeyString, nOptions)

C/C++ Syntax

long __stdcall RSA_CheckKey(const char *szKeyString, long nOptions);

Parameters

szKeyString
[in] containing the RSA public or private key in internal format
nOptions
[in] option flags: not used in this release. Specify zero.

Returns (VBA/C)

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.

.NET Equivalent

Rsa.CheckKey Method (String)
Rsa.CheckKey Method (StringBuilder)

C++ (STL) Equivalent

static bool dipki::Rsa::KeyIsPrivate (const std::string &keyStr)

Python Equivalent

static Rsa.key_isprivate(keystr)

Remarks

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.

Example

See RSA_FromXMLString.

See Also

RSA_KeyBits RSA_KeyBytes RSA_KeyHashCode

[Contents] [Index]

[PREV: RNG_UpdateSeedFile...]   [Contents]   [Index]   
   [NEXT: RSA_DecodeMsg...]

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