concept IT in category sql

This is an excerpt from Manning's book SQL Server MVP Deep Dives Vol. 2.
Matija Lah graduated from the Faculty of Law at the University of Maribor, Slovenia, in 1999. As a lawyer with extensive experience in IT, in 2001 he joined IUS SOFTWARE d.o.o., the leading provider of legal information in Slovenia, where he first came in contact with Microsoft SQL Server. In 2005 he decided to pursue a career of freelance consultant in the domain of general, business, and legal information, which in 2006 led him to join AI-in-Law Future Technologies Inc., introducing artificial intelligence into the legal information domain. Based on his continuous contributions to the SQL community, he was awarded the Most Valuable Professional award for SQL Server by Microsoft in 2007.
Listing 1. Enabling Service Broker and setting up transport security: DataReceiver
USE master -- SET UP TRANSPORT SECURITY -- create a master key for the master database -- DO NOT FORGET THIS PASSWORD AND STORE IT SOMEWHERE SAFE CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'Put_Your_Custom_Password_For_DataReceiver_Master_DB_Here' GO -- create certificate for the service broker TCP endpoint for secure --communication between servers CREATE CERTIFICATE CertificateDataTransferReceiver WITH -- BOL: The term subject refers to a field in the metadata of -- the certificate as defined in the X.509 standard SUBJECT = 'CertDataTransferReceiver', -- set the start date yyyyMMdd format START_DATE = '20111001', -- set the expiry date EXPIRY_DATE = '20500101' -- enables the certificate for service broker initiator ACTIVE FOR BEGIN_DIALOG = ON GO -- save certificate to a file and copy it to the DataSender instance -- so we can enable secure connection BACKUP CERTIFICATE CertificateDataTransferReceiver -- this path must be somewhere where we have permissions TO FILE = 'c:\CertificateDataTransferReceiver.cer' GO -- create endpoint which will be used to receive data from DataSender -- instance CREATE ENDPOINT ServiceBrokerEndPoint -- set endpoint to actively listen for connections STATE = STARTED -- set it for TCP traffic only since service broker only supports TCP --protocol -- by convention, 4022 is used but any number between 1024 and 32767 -- is valid. AS TCP (LISTENER_PORT = 4022) FOR SERVICE_BROKER ( -- authenticate connections with our certificate AUTHENTICATION = CERTIFICATE CertificateDataTransferReceiver, -- default value is REQUIRED encryption but let's just set it --to SUPPORTED -- SUPPORTED means that the data is encrypted only if the -- opposite endpoint specifies either SUPPORTED or REQUIRED. ENCRYPTION = SUPPORTED ) GO -- Finally grant the connect permissions to public. GRANT CONNECT ON ENDPOINT::ServiceBrokerEndPoint TO PUBLIC