【问题标题】:Use X509Certv3 from string for WCF Service Endpoint?将字符串中的 X509Certv3 用于 WCF 服务端点?
【发布时间】:2011-09-28 16:41:28
【问题描述】:

我已从 Win2k8 服务器将密钥对(公钥和私钥)导出到单个证书中。然后我使用 OpenSSL 将其转换为 pem:

openssl pkcs12 -in cert.pfx -out cert.pem -nodes

然后我将 .pem 的内容放入 MSSQL 表中,Varchar(max) 列类型。

仅使用 .NET Framework 4.0。

我得到这样的证书:

var bytes = Encoding.UTF8.GetBytes("certstringfromdatabase");
var cert = new X509Certificate(bytes, passwordstring);

我收到一个错误“加密异常未处理,找不到指定的对象。”

我是否错误地转换为 byte[]?这是针对具有 TCP 绑定的自定义 WCF 服务,我试图在不触及内部存储的情况下使用 SSL 证书(因为这将有一天迁移到 Azure 辅助角色,我不能使用证书存储或文件系统)。

感谢所有想法。

【问题讨论】:

    标签: wcf ssl openssl x509certificate net.tcp


    【解决方案1】:

    涉及的内容比我所做的要多得多。

    查看http://www.codeproject.com/KB/security/CertificatesToDBandBack.aspx,就是这样。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-04-17
      • 1970-01-01
      • 2013-10-19
      • 1970-01-01
      • 1970-01-01
      • 2011-11-13
      • 1970-01-01
      相关资源
      最近更新 更多