使用VB.net安装证书

时间:2018-01-18 08:29:14

标签: vb.net

如何在特定的商店位置使用vb.net安装证书,例如在“受信任的根证书颁发机构”下的“注册表”中。以下示例恰好位于根目录下,但不在“Registry”文件夹中。

Dim yourCert As New X509Certificate2(Application.StartupPath & "\xxx.pfx", "xxxx")
Dim store As New X509Store(StoreName.Root, StoreLocation.LocalMachine)
store.Open(OpenFlags.ReadWrite)
store.Add(yourCert)
store.Close()

0 个答案:

没有答案
相关问题