Data.DBXOpenSSL.TRSACypher.GenerateKey

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure GenerateKey(keyLength: Integer = RSA_KEY_LENGTH; Exponent: int64 = RSA_KEY_EXPONENT);

C++

void __fastcall GenerateKey(int keyLength = 0x400, __int64 Exponent = 3LL);

Properties

Type Visibility Source Unit Parent
procedure
function
public
Data.DBXOpenSSL.pas
Data.DBXOpenSSL.hpp
Data.DBXOpenSSL TRSACypher

Description

Generates a new RSA key pair.

Depending on the key-usage policy that you specify when you create your RSA cypher, this new key pair is either global or local.

GenerateKey accepts the following parameters:

  • keyLength is the length of the generated key. The default value is the value of the RSA_KEY_LENGTH constant.
  • Exponent is the exponent of the generated key. It must be a prime number. The default value is the value of the RSA_KEY_EXPONENT constant.

Exceptions

GenerateKey may raise any of the following exceptions:

Class Message Description

TDBXError

SSL module was not loaded or it was not loaded successfully. Use LoadSSL method to load the module

You must successfully load the SSL module using LoadSSL before you call GenerateKey.

<SSL error message>

An exception may be raised if an error occurs within the underlying HTTPS framework. The error message comes from the framework itself.

See Also