CryptoSys PKI Pro Manual

rsaEncrypt

Encrypt a short message using RSA encryption.

Syntax

[VBA]
Public Function rsaEncrypt ( _
    lpInput() As Byte, _
    szPublicKeyFile As String, _
    Optional nOptions As Long = 0, _
    Optional szParameters As String = "" _
) As Byte()

Parameters

lpInput
Data to be encrypted.
szPublicKeyFile
Name of the public key file or X.509 certificate, or a string containing the key or certificate in PEM format, or a valid internal public key string.
nOptions
Select one of the following:
PKI_EME_PKCSV1_5 (0 default)
PKI_EME_OAEP
If you have selected PKI_EME_OAEP, then add one of these options to set the hash function for EME-OAEP encoding:
PKI_HASH_SHA1
PKI_HASH_SHA224
PKI_HASH_SHA256
PKI_HASH_SHA384
PKI_HASH_SHA512
and, optionally, add PKI_MGF_MGF1SHA1 to force the MGF hash function to be SHA-1 (default = same as encoding hash function set above).
szParameters
For future use.

Return Value

Byte(): Encrypted data or an empty array on error.

Remarks

Note different order of parameters from core function.
[PREV: rsaEncodeMsg...]   [Contents]   [Index]   
   [NEXT: rsaFromXMLString...]

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