Thread: SQL Server 2005
View Single Post
  #14 (permalink)  
Old 10-16-2007, 01:40 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default CREATE CERTIFICATE SQL Server 2005

CREATE CERTIFICATE

Add a certificate to the database.

Syntax:
CREATE CERTIFICATE certificate [ AUTHORIZATION user_name ]
{FROM existing_keys | generate_new_keys }
[ACTIVE FOR BEGIN_DIALOG = {ON | OFF }]


existing_keys:
ASSEMBLY assembly_name
{[EXECUTABLE ] FILE = 'path_to_file' [WITH PRIVATE KEY ( private_key_options )]}

generate_new_keys:
[ENCRYPTION BY PASSWORD = 'password']
WITH SUBJECT = 'certificate_subject_name'
[ , date_options [ ,...n ] ]

private_key_options:
FILE = 'path_to_private_key'
[, DECRYPTION BY PASSWORD = 'password' ]
[, ENCRYPTION BY PASSWORD = 'password' ]

date_options:
START_DATE = 'mm/dd/yyyy'
EXPIRY_DATE = 'mm/dd/yyyy'

Key:
user_name The user that will own the certificate.
assembly_name A signed assembly already loaded into the database.
path_to_file The path (local or UNC) , including filename
to a DER-encoded file that contains the certificate.
WITH PRIVATE KEY Load the private key of the certificate into SQL Server.
START_DATE Date the certificate becomes valid (default=current date.)
EXPIRY_DATE Date the certificate expires (default= 1 year after START_DATE)
ACTIVE FOR BEGIN_DIALOG Make available to the initiator of a Service Broker dialog conversation.

Users of these built-in functions for encryption and signing must decide when to check if the certificate has expired.

Example

USE MyDb;
CREATE CERTIFICATE SS64
ENCRYPTION BY PASSWORD = 'pG6464qwerty247y'
WITH SUBJECT = 'Demonstration certificate',
EXPIRY_DATE = '02/28/2014';
GO
__________________
The KINGMAKER
Makes Every Thing Possible

Stuffs (My Blog)
Reply With Quote