将 .pfx 证书附加到 exe 文件
我必须将一个软件部署到 n 个客户端来安装证书并使用它。我不想部署两个文件(.pfx 和 exe),而只部署一个文件(.exe 将包含 .pfx)。
我现在正在做的是从某个位置导入证书。
X509Certificate2^ x509 = gcnew X509Certificate2;
x509->Import( "C:\\Tmp\\certficate.pfx" );
是否可以 ?
I have to deploy a software to n clients that will install a certificate and use it. I don't want to deploy two files (.pfx and exe) just one (.exe that will contain the .pfx).
What i'm doing now is import the certificate from a location.
X509Certificate2^ x509 = gcnew X509Certificate2;
x509->Import( "C:\\Tmp\\certficate.pfx" );
Is it possible ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您始终可以将证书数据作为资源嵌入。
但有一个警告:如果有人获得了可执行文件,他们就可以很容易地提取出 PFX 文件。
您能够安全地分发可执行文件吗?
以下是一些粗略步骤,摘自: http://www.spikezilla-software.com /blog/?p=24
这是 C#,但您应该能够非常轻松地转换为 C++/CLI:
You could always embed the certificate data as a resource.
One warning though: if someone gets the executable, they can pull out the PFX file pretty easily.
Are you able to securely distribute the executable?
Here are some rough steps, distilled from: http://www.spikezilla-software.com/blog/?p=24
This is C# but you should be able to translate to C++/CLI pretty easily:
一旦我嵌入它,这对我有用。
This worked for me once I embedded it.