Click here to Skip to main content
15,172,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am new to QT.I want to download ssl certificate and stored in usb token.I have over all basic knowledge in QT.Please provide me some sample code if possible.Please help me.
Posted

1 solution

Downloading SSL certificates is usually done using the OpenSSL libraries. So install these libraries and add the path and library names to the LIBS variable in your Qt project file.

You need than to create a socket, connect to the server, and call the required OpenSSL library functions. With Qt, you can use the QTcpSocket[^] class and use the member function socketDescriptor[^] to get the descriptor to be passed to the SSL functions. See http://www.zedwood.com/article/cpp-libssl-get-peer-certificate[^] on how to fetch the certificate.

How the certificate can be stored in your USB token programmatically should be documented by the manufacturer of the token.
   
Comments
Member 11091184 14-Nov-14 4:37am
   
Thanks Jochen for your reply.

I want to be more specific about my requirement. That is I want to generate a certificate request (CreatePKCS10 using xenroll or any other) to our service which then gives me the certificate in my QT application and download it to the Token through my application. I am working for a Certifying Authority which requires the application to be done in QT.
Jochen Arndt 14-Nov-14 5:24am
   
I'm now not really sure now where you have problems.

Qt is just a frame work. It is mainly for the GUI but provides also OS independant classes for OS specific tasks (like the mentioned network class). If the final application should not run on different OS, you can still use OS specific functions (e.g. all Windows SDK functions). Otherwise you must create OS specific code for that portions that can't be handled unique due to missing support by Qt.

[EDIT]
I just saw that you posted a new question about storing to the USB token.
You should provide more information about the used token. As already noted, the manufacturer should have some documentation. The basic question is: Uses the token a special device driver or is it a common USB device?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900