|
The function generates your private key with the key length. The free version
uses the fixed key size - 256 bits. The password should be 4 or more chars. After successful execution @PrivateKey variable
includes a private key which is used for decryption or later for public key
generation. @PublicKey variable includes the public key used for data encryption.
It is a good idea to save both keys now - @PrivateKey with a password and @PublicKey -
without one.
In the environment of quickly growing technical progress the key length which
is less than 1024
bits should be considered unsecure.
Syntax
xp_rsa_generate_couple { key size, private_key OUTPUT, pubilc_key
OUTPUT }
Arguments
key size
VARCHAR. Size (in bits) of RSA key to be generated. Free version supports only
'256'.
private_key
VARCHAR. On success, this variable holds the newly generated private key
pubilc_key
VARCHAR. On success, this variable holds the newly generated private key
Permissions
Execute permissions for xp_rsa_generate_couple default to members of
the db_owner fixed database role in the master database, but can
be granted to other users.
Return Code Values
0 - success, or Error code
if failed. private_key IS NOT NULL (success) or IS NULL (failure)
Example
declare @PrivateKey varchar (20)
declare @PublicKey varchar (20)
-- Creates Private key of 1024 bit length and returns key handles
exec xp_rsa_generate_couple '1024' , @PrivateKey output, @PublicKey output
|
|