views:

123

answers:

2

I have Windows Server 2003 Standard x64 Edition SP2 with

Microsoft SQL Server 2005 - 9.00.4035.00 (X64) Enterprise Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 2)

I downloaded CAPICOM Platform SDK Redistributable: http://www.microsoft.com/downloads/details.aspx?FamilyId=860EE43A-A843-462F-ABB5-FF88EA5896F6&displaylang=en

and installed it from c:\Windows\syswow64 with c:\Windows\syswow64\regsvr32.exe capicom.dll and it got registered succesfully.

When I tried to run

DECLARE @S varchar(255) 
DECLARE @D varchar(255)
DECLARE @O int

EXEC @C = sp_OACreate 'CAPICOM.EncryptedData', @O OUT
IF @C <> 0
BEGIN
  EXEC sp_oageterrorinfo @O, @S out, @D out 
  SELECT err=CONVERT(VARBINARY(4),@C), source=@S, description=@D
  RETURN
END

and I got error message.

0x80040154  ODSOLE Extended Procedure    Class not registered

What should I do? How should I check if CAPICOM.DLL is correctly registered?

+1  A: 

Here is the reason.
Is there a 64 bit version of this component?

shahkalpesh
Thanks a lot. I am afraid there is no 64bit version of this component.
THEn
+1  A: 

CAPICOM will not ship 64 bit afaik, is deprecated:

CAPICOM is a 32-bit only component that is available for use in the following operating systems: Windows Server 2008, Windows Vista, Windows XP, and Windows 2000. Instead, use the .NET Framework to implement security features. For more information, see Alternatives to Using CAPICOM

Between the crypto functions in SQL 2005 itslef and the CRL procedures access to .Net crypto, frankly I don't see any reason to stick with the COM crypto API. Certainly, I understand that you can have legacy code and need to support it, bur for new development definetly a big no no.

Remus Rusanu
It is about third party application that I support. Is there any way in 64bit SQL server to decrypt the data that was encrypted with CAPICOM?
THEn
SQL Server own function won't decrypt CAPICOM encrypted data because they use their own format (they append the initialization vector for instance). But a CLR function or procedure is perfectly capable of decrypting CAPICOM data using the System.Cryptography components.
Remus Rusanu