Page 1 of 1

Using certificate

Posted: Sun 03 Feb 2013 15:02
by anders_g
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

Re: Using certificate

Posted: Mon 04 Feb 2013 16:24
by Dimon
You can use the TScCertificate.Handle property.

Re: Using certificate

Posted: Mon 04 Feb 2013 22:20
by anders_g
??

Just like:

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


???

Thanks
Anders

Re: Using certificate

Posted: Tue 05 Feb 2013 09:48
by Dimon
Use the following code:

Code: Select all

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

Re: Using certificate

Posted: Tue 05 Feb 2013 09:58
by anders_g
Thanks a lot - seems promising! I will try it out.

/Anders

Re: Using certificate

Posted: Tue 05 Feb 2013 13:26
by Dimon
Feel free to contact us if you have any further questions about SecureBridge.