|
Generates private and public DSA keys with the length of size. A free
version of XP_CRYPT uses a fixed key size - 512 bits. Unlike RSA keys DSA
keys cannot be used for encryption, they are used for digital
signatures only. Comparing to RSA keys, they provide a faster and more effective sign algorithm.
The password should be 4 or more chars. After
successful execution @PrivateKey variable has the private key used for data
signing as well as for generating the public key later. @PublicKey variable has
the public
key used for sign verification data. It is a good idea to save both keys now - @PrivateKey with
a password and @PublicKey - without. In the environment
of the quickly growing technical progress the key length less than 1024
bits should be considered as unsecure.
Syntax
xp_dsa_generate_couple { key size, private_key
OUTPUT, pubilc_key OUTPUT }
Arguments
key size
VARCHAR. Size (in bits) of the DSA key to be generated. The free version
supports only '512'.
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_dsa_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 (10)
declare @PublicKey varchar (10)
-- Creates private and public key of 512 bit length and return key
handles
exec xp_dsa_generate_couple '512' , @PrivateKey output, @PublicKey
output
|
|