Dec 15, 2009 at 2:29 PM
Edited Dec 15, 2009 at 3:18 PM
Thank you Sarah
I am going to try ...
I must use a CLR function in order to create a Hash.
I'm trying to use an assembly called Cryptography that references the Cryptography Application Block.
There are several steps involved:
* Create the CLR Dll for the SQL function to use.
o This .NET assembly references Microsoft.Practices.EnterpriseLibrary.Security.Cryptography; Microsoft.Practices.EnterpriseLibrary.Common;
* Register the CLR Dll in SQL server
* Create a normal SQL function that uses the CLR Dll
create assembly SQLServerEncryption from 'c:\Cryptography.dll' WITH PERMISSION_SET = UNSAFE
alter assembly SQLServerEncryption add file from 'c:\Cryptography.dll.config'
CREATE FUNCTION [dbo].[GETHASH]() RETURNS [nvarchar](255) WITH EXECUTE AS CALLER AS EXTERNAL NAME [SQLServerEncryption].[Cryptography].[GetHash]
select dbo.[GETHASH]( )
This last instruction returns the following error message:
Msg 6522, Level 16, State 2, Line 1
A .NET Framework error occurred during execution of user-defined routine or aggregate "GETHASH":
System.Configuration.ConfigurationErrorsException: The configuration section securityCryptographyConfiguration is not defined in the current configuration for the AppDomain.
How to access the App.config that the Cryptography Application Block uses?
Any help will be appreciated.