CryptoSys PKI Pro Manual

RSA_ReadPublicKey

Reads from an RSA public key file into an "internal" public key string. [Superseded by RSA_ReadAnyPublicKey.]

VBA/VB6 Syntax

Public Declare Function RSA_ReadPublicKey Lib "diCrPKI.dll" (ByVal strPublicKey As String, ByVal nOutChars As Long, ByVal strKeyFileName As String, ByVal nOptions As Long) As Long

nRet = RSA_ReadPublicKey(strPublicKey, nOutChars, strKeyFileName, nOptions) As Long

C/C++ Syntax

long __stdcall RSA_ReadPublicKey(char *szOutput, long nOutChars, const char *szPubKeyFile, long nOptions);

Parameters

szOutput
[out] to receive public key data in encoded "internal" format.
nOutChars
[in] specifying the maximum number of characters to be received.
szPubKeyFile
[in] specifying the filename of a public key file (or a string containing the key in PEM format).
nOptions
[in] option flags: not used in this release. Specify zero.

Returns (VBA/C)

If successful, the return value is the number of characters in or required for the output string; otherwise it returns a negative error code.

VBA Wrapper Syntax

Public Function rsaReadPublicKey (szKeyFileOrString As String, Optional nOptions As Long = 0) As String

.NET Equivalent

Rsa.ReadPublicKey Method

Remarks

Both PKCS-1 RSAPublicKey and OpenSSL SubjectPublicKeyInfo formats are supported. The file can be in binary BER-encoded format or PEM format, or be passed as a string containing the data in PEM format. Call the function with an empty or NULL szOutput string or zero nOutChars parameter to find out the required length of the output string. C/C++ users should add one to this value when allocating memory.

Example

See Also

RSA_ReadAnyPublicKey RSA_SavePublicKey RSA_GetPublicKeyFromCert

[Contents] [Index]

[PREV: RSA_ReadPrivateKeyInfo...]   [Contents]   [Index]   
   [NEXT: RSA_SaveEncKey...]

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