|
This function is used to change the parameters of your current
session.
Syntax
xp_crypt_set_option { parameter_name, parameter_value }
Arguments
parameter_name
VARCHAR. Name of the parameter.
parameter_value
VARCHAR. Value of the parameter. Currently supported parameters:
| Parameter name |
Accepted values |
| 'use_crlf' |
'yes' Default. Inserts a new line code into the base64
encoded output |
| 'no' Does not insert a new line codes into the base64
encoded output |
| 'pswd_cache' |
'yes' Provides password caching and loads
private keys with specifying a password '?' . XP_CRYPT will use the
password that was used last time with xp_rsa_load_key or
xp_rsa_save_key. The session can store passwords for different sources. |
| 'no' Default. Does not permit caching passwords. |
| 'timeout' |
Timeout in minutes as a VARCHAR value. The default value
is 5 minutes |
Return Code Values
0 - success, or Error code
if failed.
Permissions
Execute permissions default to the public role.
Example
-- Initialize session
exec xp_crypt_init_session
-- Set timeout to 1 minute
exec xp_crypt_set_option 'timeout','1'
exec xp_crypt_set_option 'use_crlf','no'
....
-- Encrypt string and get the result without new line feeds
exec xp_rsa_priv_dec @CryptedText, '<privatekey.pem', @name
OUTPUT, @dateofbirth OUTPUT , @department OUTPUT, 'PassForThePrivateKey'
-- Close session
exec xp_crypt_close_session
|
|