FirebirdSQL logo

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.

RSA_PRIVATE Examples

select rdb$set_context('USER_SESSION', 'private_key', rsa_private(256))
  from rdb$database;
Warning

Putting private keys in the context variables is not secure;we’re doing it here for demonstration purposes.SYSDBA and users with the role RDB$ADMIN or the system privilege MONITOR_ANY_ATTACHMENT can see all context variables from all attachments.