如何在Qt中下载Ssl证书到Usb令牌 [英] How Can I Download A Ssl Certificate To Usb Token In Qt.

查看:151
本文介绍了如何在Qt中下载Ssl证书到Usb令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我是QT的新手。我想下载ssl证书并存储在usb令牌中。我已经掌握了QT的所有基本知识。请发布如果可能,请提供一些示例代码。请帮助我。

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.

推荐答案

下载SSL证书通常使用OpenSSL库完成。因此,安装这些库并将路径和库名称添加到Qt项目文件中的 LIBS 变量。



您需要创建一个套接字,连接到服务器,并调用所需的OpenSSL库函数。使用Qt,您可以使用 QTcpSocket [ ^ ]类并使用成员函数 socketDescriptor [ ^ ]获取要传递给SSL函数的描述符。请参见 http://www.zedwood.com/article/cpp-libssl-get-peer-certificate [ ^ ]关于如何获取证书。



如何以编程方式将证书存储在您的USB令牌中应该由令牌制造商记录。
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.


这篇关于如何在Qt中下载Ssl证书到Usb令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆