Using certificate

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
anders_g
Posts: 8
Joined: Sun 03 Feb 2013 14:55

Using certificate

Post by anders_g » Sun 03 Feb 2013 15:02

In our app, where we today use CAPICOM, we have the following code:

WinApi.InternetSetOption(
AData, INTERNET_OPTION_CLIENT_CERT_CONTEXT, PCertContext, Sizeof(CERT_CONTEXT))

I am investigating the possibility to change to the SecureBridge implementation of CryptoAPI. If I use a TScCryptoAPIStorage to get a certificate - what is the "PCertContext" equivalent?

/Anders

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: Using certificate

Post by Dimon » Mon 04 Feb 2013 16:24

You can use the TScCertificate.Handle property.

anders_g
Posts: 8
Joined: Sun 03 Feb 2013 14:55

Re: Using certificate

Post by anders_g » Mon 04 Feb 2013 22:20

??

Just like:

h := <a certificate>.handle;
WinApi.InternetSetOption(
AData, INTERNET_OPTION_CLIENT_CERT_CONTEXT, h, Sizeof(h));


???

Thanks
Anders

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: Using certificate

Post by Dimon » Tue 05 Feb 2013 09:48

Use the following code:

Code: Select all

h := <a certificate>.handle;
WinApi.InternetSetOption(
  AData, INTERNET_OPTION_CLIENT_CERT_CONTEXT, h, Sizeof(CERT_CONTEXT));

anders_g
Posts: 8
Joined: Sun 03 Feb 2013 14:55

Re: Using certificate

Post by anders_g » Tue 05 Feb 2013 09:58

Thanks a lot - seems promising! I will try it out.

/Anders

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: Using certificate

Post by Dimon » Tue 05 Feb 2013 13:26

Feel free to contact us if you have any further questions about SecureBridge.

Post Reply