This document describes a sample usage of the Trust Services for a Data Hub scenario where the Publisher publishes a blob of data to Azure to be accessed by another party, the Data Consumer. The Publisher & Consumer are in their trusted environments and the Azure blob is untrusted for storing the data being shared. Trust Services is used to enable this scenario by encrypting the publisher’s data using Trust Services SDK in his trusted environment first prior to him storing it in Azure. The Consumer in his trusted environment then downloads this encrypted data from Azure and decrypts it to retrieve the publisher’s data.
Usage Overview document states the problem domain and provides a usage description. Visit Trust Services Samples Download page to download samples.
The demo scenario involves 4 parties:
In this scenario, the steps are as called out in the Usage Overview document:
The TSPA, Publisher and Consumer perform their actions in their PCs using the Trust Services SDK. The sample solution implements these actions. In this sample, the sensitive data is a blob of data that is stored in an Azure blob.
Link to download SDK: Trust Services SDK MSI. For specifics on the C# API, open "Trust Services SDK Help" from Start Menu once SDK is installed.
The pre-requisites to run this sample are:
You must have self-signed certificates for the TSPA, Publisher and Consumer available. You can create your own certificates.
Run the following commands from a Visual Studio command prompt to create a self-signed certificate:
makecert -r -pe -n "CN=Alice" -sky exchange "Alice.cer" -sv "Alice.pvk"
You will be prompted for a password to secure the private key three times. Enter a password of your choice.
Then enter the following command to create the .pfx file. After the –pi switch, enter the password you chose.
pvk2pfx -pvk "Alice.pvk" -spc "Alice.cer" -pfx "Alice.pfx" -pi password-entered-in-previous-step
You can verify that the certificate has been created by looking in the current directory in the Visual Studio command prompt. You should have three files: (1) Alice.cer – the file with only the Public Key (2) Alice.pvk – the file with the Private Key (3) Alice.pfx – the file with both the Private & Public Keys.
For this sample, you will need the .cer file and the .pfx file. Repeat the above steps for the three roles: TSPA, Publisher and Consumer.
As this sample uses the Windows Azure Blob store, the Windows Azure SDK is required.
Note: This sample has been tested with Version 1.4 but should work with the latest SDK as well.
This is the “Create a Trust Services Server” step described in the Trust Services Usage Overview document.
Tip: Make a note of the Trust Server name. This will be needed in subsequent actions on the client machines.
The sample solution is a Visual Studio 2010 solution. The TSAzureBlobConsoleSample.sln can now be loaded in Visual Studio. Add references to the Trust Services SDK DLLs, and do “Build solution” (F6 button). On successful build completion, the executable can be used to perform the following steps described in the Trust Services Usage Overview document.
Note: The app.config file in the TSAzureBlobConsoleSample Project contains the Service URL for Trust Services (key is TSSvc) https://trustservicesapi2.cloudapp.net/.
You can also verify the data is protected by viewing the blob storage in the development storage using the Azure Storage Explorer. The blob container name is tscontainer (refer to initBlobStore method in the RoleHandler class).
Note: These three roles (Admin, Data Publisher and Data Consumer) can be executed on different machines.
Learn More
Getting Started Tutorial
Request Registration Code
Download "Trust Services" SDK
Access "Trust Services" Portal
Samples
Troubleshooting
SQL Azure Labs Forums