问题标签 [certificate-store]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
27660 浏览

c# - 在 C# 中将证书安装到 Windows 本地用户证书存储中

我正在编写一个 Windows 服务,它需要证书存储中的多个证书才能连接到第三方 Web 服务。

在我的安装程序上,我调用了一个小型应用程序 (C#),它创建了一个用户来运行服务。

它工作正常。

我现在需要在用户证书存储中安装大约 10 个证书(不要问!),但找不到任何简洁的编程方式来做到这一点。

有什么提示吗?或者我将不得不使用COM互操作...

0 投票
5 回答
111224 浏览

c# - 从 C# 中的证书存储中获取证书列表

对于安全应用程序,我需要在对话框中选择一个证书。如何使用 C# 访问证书存储或其一部分(例如storeLocation="Local Machine"storeName="My")并从那里获取所有证书的集合?在此先感谢您的帮助。

0 投票
2 回答
37103 浏览

visual-studio - “我的”证书存储在哪里?

因为我很棒,我正在尝试在我的 7 boxen 上使用 VS2k10 B2 运行最新的 WIF 演示应用程序……当然是 64 位(我的胡须很强壮)我在运行它时遇到了问题。

整个演示的一部分需要我在本地机器上安装一些证书。问题是他们要求我将一些网站证书安装到名为LocalMachine/My的证书存储中。好吧,似乎没有任何/My了。出现了一个可疑的类似商店,名为Personal,但如果我在那里安装证书并更改配置以查看LocalMachine/Personal ,该应用程序将无法运行。

如果我在TrustedPeople中安装证书(当我尝试使用 Personal 时抛出的异常将其称为有效位置),这就足够了吗?在生产机器上这样做会被认为是不好的形式吗?


Windows Identity Foundation 测试项目位于: http ://claimsbasedwpf.codeplex.com

例外:

属性名称:'certificateReference' 错误:'ID1025:找不到符合条件的唯一证书。StoreName:“我的”StoreLocation:“LocalMachine”X509FindType:“FindBySubjectDistinguishedName”FindValue:“CN=busta-rpsts.com”

0 投票
1 回答
815 浏览

certificate - 带有 Windows 证书存储的 OpenSSL SSL_CTX_use_PrivateKey_file

我有一个使用 OpenSSL 进行 TLS 的本地 C++ 库。它使用 SSL_CTX_use_PrivateKey_file 读取私钥,一切都很好,

然后我创建了一个 C# 包装器,它根据某些 OID 和主题名称从 Windows 证书存储中读取证书。这就是问题所在 - 我可能会获得不止一个证书。我该如何处理?尝试所有这些?

是否可以在 PEM 文件中保存多个私钥?

非常感谢你。

0 投票
4 回答
16211 浏览

java - 在 Java 中访问本地机器证书存储?

是否可以从 Java Servlet 访问存储在本地机器存储(而不是当前用户)中的证书?我尝试使用 MSCAPI 提供程序打开“Windows-MY”和“Windows-ROOT”存储,但都不包含来自本地机器存储的证书。

0 投票
3 回答
11761 浏览

c# - 获取 C# 中的证书存储名称列表

我可以使用以下语句在特定商店中获取证书集合。

X509Store.Certificates

但不确定如何获取当前用户或本地计算机下存在的证书存储名称列表。我还检查了 StoreName 枚举,但它只列出标准商店名称,而不是用户定义的名称。

我想要证书商店的列表,而不是特定商店中的证书列表。

0 投票
2 回答
7475 浏览

x509certificate - WCF, Certificate Authentication - Common Errors and Confusing Arguments

I am trying to setup a WCF service to use a Certificate for Authenticating the client. I have read tons of posts on how to create the certificate, and I have been able to do so (finally).

I am installing the Cert Authority and the Cert on a server that runs Windows 2008 R2. When I open the MMC Certificates Snap-in, I choose Computer Account. Is this correct? I am doing this because my WCF service will run in a Windows Service, and will be running even when no user's are logged in. But admittedly, I don't know what the difference is between the three options:

  1. My user account
  2. Service account
  3. Computer account

Once the snap-in loads, I import the Authority Cert into Trusted Root Certification Authorities. Then, I import the cert into Trusted Publishers. I don't encounter any errors when doing this. When I do the import, of both the Authority Cert and the Cert signed by that authority, I don't make any reference to the .pvk file. It is my understanding that the private key is embedded in either the cert or the authority cert. Here are the commands I use to create each cert:

Notice I used -ss root. I have seen many posts using -ss My. I don't really understand what the difference is or when it is appropriate to use each value.

My WCF service runs on this machine inside a Managed Service (Windows Service). When I start my windows service, which hosts the WCF service, it crashes immediately and a seemingly common error is reported in the event viewer:

System.ArgumentException: It is likely that certificate 'CN=TempCertName' may not have a private key that is capable of key exchange or the process may not have access rights for the private key

I have found posts that say I need to grant permissions to the user running the service to the key.

This one seems to be a popular answer here on stackoverflow: Grant access with All Tasks/Manage Private Keys

But I don't have the option of All Tasks/Manage Private Keys

But I'm not clear on how to do that. But also, the service is running under my domain account, which is an administrator and is also the same user that installed the cert.

Please Help :)

0 投票
1 回答
4134 浏览

windows - 将 Windows 证书存储中的证书和私钥与 OpenSSL 一起使用

我正在尝试制作一个在 Delphi XE 中使用某些 Web 服务的程序。要连接到 Web 服务,我必须使用存储在 Windows 证书存储中的自签名证书。我使用 CertOpenSystemStore 打开证书存储,获取证书CertFindCertificateInStore并使用SSL_CTX_use_certificate. 这没问题。然后我得到公钥 blobCryptExportKey并组成这样的私钥:

SSL_CTX_use_PrivateKey然后我设置它SSL_CTX_check_private_key- 到目前为止没有问题。但是当数据传输开始时,我在 libeay32.dll 中遇到了访问冲突。如果我从 .pem 文件加载密钥,一切都很好。我看不出我做错了什么,请帮忙:)

这是确切的错误消息:

模块“libeay32.dll”中地址 09881C5F 的访问冲突。读取地址 00000000。

libeay32.dll 版本为 1.0.0.5。尝试使用版本 0.9.something 也有同样的错误,只是地址不同。

以下是我进入的 RSA 结构PrivKeyBlob2RSA

我检查了 n 和 e bignums,它们是正确的,其他一切看起来都很好。是的,调用函数时会发生错误ssl_read

0 投票
3 回答
5130 浏览

delphi - 如何使用 Delphi 访问 Windows 根证书颁发机构证书?

与 Lazarus 或 Delphi 有关的问题。有没有办法以编程方式访问 Windows 中受信任的根证书颁发机构证书。我知道 Windows 中有一个名为“mmc.exe”的基于 GUI 的工具,但我需要使用 Object Pascal 语法访问证书文件(如 .crt 或 .cer 或 .pem 等)。任何人都可以帮助我吗?

0 投票
1 回答
447 浏览

encryption - NTFS EFS:如何将加密证书从一个文件复制到(一个)其他文件?

我想将与一个标记文件关联的所有加密证书复制到一组其他文件中。

当然,有QueryUsersOnEncryptedFile一个返回 aPENCRYPTION_CERTIFICATE_HASH_LIST的函数,还有AddUsersToEncryptedFile一个接受 a的函数PENCRYPTION_CERTIFICATE_LIST

因此,据我了解,要复制证书,这些哈希需要转换回证书列表。

为了进行这种转变,我一直在搞乱CertFindCertificateInStore. 这在某种程度上起作用了,但不是所有证书,我什至不知道我应该查询哪些证书存储......我确实尝试了一些:CA,,,,,,,(甚至ROOT,这似乎包含过期的证书缓存,因为其中一些已经过期)但它们都没有让我访问我拥有哈希值的所有证书。MYSPCTrustTrustedPeopleAuthRootAddressBook

那么,我怎样才能可靠地将证书哈希映射回证书本身呢? (一些示例代码会很好。)

提前致谢!


作为旁注:

我还想从这些相同的目标文件中删除所有其他证书。为此,有一个可用的函数,称为RemoveUsersFromEncryptedFile,它也需要一个PENCRYPTION_CERTIFICATE_HASH_LIST.

我想这个列表可以通过首先调用QueryUsersOnEncryptedFile每个文件来收集,然后将生成的证书哈希列表传递给RemoveUsersFromEncryptedFile(在同一个文件上)。

但是有一个警告:我不想丢失所有证书,否则任何人都无法访问这些文件!我可以从这个中间哈希列表中安全地将我自己的(以及任何其他允许的)证书哈希清零吗?(鉴于还有一个专用FreeEncryptionCertificateHashList功能。)