Create an asymmetric key in the database.
Syntax: CREATE ASYMMETRIC KEY Asym_Key_Name [AUTHORIZATION database_principal_name] FROM <Asym_Key_Source> [ENCRYPTION BY PASSWORD = 'password'] CREATE ASYMMETRIC KEY Asym_Key_Name [AUTHORIZATION database_principal_name] WITH ALGORITHM = { RSA_512 | RSA_1024 | RSA_2048 } [ENCRYPTION BY PASSWORD = 'password'] Key: Asym_Key_Source: The source from which to load the asymmetric key pair: FILE = 'path_to_strong-name_file' EXECUTABLE FILE = 'path_to_executable_file' ASSEMBLY Assembly_Name database_principal_name The owner of the asymmetric key. The owner cannot be a role or a group. default = current user. 'path_to_strong-name_file' Path of a strong-name file from which to load the key pair. 'path_to_executable_file' An assembly file from which to load the public key. Assembly_Name Name of an assembly from which to load the public key. 'password' Password with which to encrypt the private key. default = encrypt using the database master key.
An asymmetric key is a secured at the database level. In its default form, this entity contains both a public key and a private key. The private key can be 512, 1024, or 2048 bits long.
Without the FROM clause, CREATE ASYMMETRIC KEY generates a new key pair.
With the FROM clause, CREATE ASYMMETRIC KEY imports a key pair from a file or imports a public key from an assembly.
If no database master key has been created, a password is required to protect the private key.
Requires CREATE ASYMMETRIC KEY permission on the database.
Examples
CREATE ASYMMETRIC KEY MyKey01 WITH ALGORITHM = RSA_2048 ENCRYPTION BY PASSWORD = 'fmsA$ek7i82bv64fobjsd2764'; GO CREATE ASYMMETRIC KEY MyKey02 AUTHORIZATION JDoe FROM FILE = ' c:\Certs\JDoe.tmp' ENCRYPTION BY PASSWORD = '35agRofg0sjlkfssJ454GX72$262'; GO
"Success is not the key to happiness. Happiness is the key to success. If you love what you are doing, you will be successful" ~ Herman Cain
Related Commands:
ALTER ASYMMETRIC KEY
DROP ASYMMETRIC KEY
Equivalent Oracle command: ALTER USER AUTHENTICATED USING CERTIFICATE