FirebirdSQL logo

RSA_ENCRYPT Examples

Tip

Run the examples of the RSA_PRIVATE and RSA_PUBLIC functions first.

select rdb$set_context('USER_SESSION', 'msg', rsa_encrypt('Some message'
  key rdb$get_context('USER_SESSION', 'public_key'))) from rdb$database;

RSA_PRIVATE()

Generates an RSA private key

Result type

VARBINARY

Syntax
RSA_PRIVATE (key_length)
Table 1. RSA_PRIVATE Function Parameters
Parameter Description

key_length

Key length in bytes;minimum 4, maximum 1024.A size of 256 bytes (2048 bits) or larger is recommended.

RSA_PRIVATE generates an RSA private key of the specified length (in bytes) in PKCS#1 format.

Note

The larger the length specified, the longer it takes for the function to generate a private key.