本文介绍了存储在DB的X509Certificate2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有可能一个X509Certificate2存储在SQL Server表,而不是拉从文件系统.p12文件?我敢肯定,你可以,但不知道如何去了解这一点。
Is it possible to store an X509Certificate2 in a SQL Server table rather than pull a .p12 file from the file system? I'm sure you can but not sure how to go about this.
推荐答案这是绝对有可能的X509Certificate2有一个可以保存RAWDATA 财产到SQL数据库。为了重建可以使用的证书,这个构造
This is definitely possible, the X509Certificate2 has a RawData property that can be saved into your SQL Database. To reconstruct the certificate you can use this constructor
var cert = new X509Certificate2(filename); var data = cert.RawData; // save data to database... // Fetch data from database... cert = new X509Certificate2(data);更多推荐
存储在DB的X509Certificate2
发布评论