CryptoSys PKI Pro Manual

Rsa.Encrypt Method

Encrypt a short message using RSA encryption.

Syntax

[C#]
public static byte[] Encrypt(
	byte[] data,
	string publicKeyFile,
	Rsa.EME method,
	Rsa.HashAlg hashAlg,
	Rsa.AdvOptions advOpts
)
[VB.NET]
Public Shared Function Encrypt ( _
	data As Byte(), _
	publicKeyFile As String, _
	method As Rsa.EME, _
	hashAlg As Rsa.HashAlg, _
	advOpts As Rsa.AdvOptions _
) As Byte()

Parameters

data
Data to be encrypted
publicKeyFile
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.
method
Type: Rsa.EME
Encoding method [optional, default = EME.PKCSv1_5]
hashAlg
Type: Rsa.HashAlg
Hash function for EME-OAEP encoding, otherwise ignored.
advOpts
Type: Rsa.AdvOptions
Advanced options for EME-OEAP only.

Return Value

Encrypted data or an empty array on error.

See Also

VB6/C equivalent: RSA_Encrypt

[Contents] [Index]

[PREV: Rsa.EncodeMsgIso9796 Method...]   [Contents]   [Index]   
   [NEXT: Rsa.FromXMLString Method (String)...]

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