CryptoSys PKI Toolkit Manual

RSA_CheckKey

RSA_CheckKey checks if an RSA key is valid.

VB6/VBA Syntax

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

nRet = RSA_CheckKey(strKeyString, nOptions)

Parameters

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

C/C++ Syntax

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

Returns (VB6/C)

Long: 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)

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]

[HOME]   [NEXT: RSA_DecodeMsg...]

Copyright © 2004-10 D.I. Management Services Pty Ltd. All rights reserved.