【问题标题】:cannot find requested object - System.Security.Cryptography.X509Certificates找不到请求的对象 - System.Security.Cryptography.X509Certificates
【发布时间】:2019-05-21 14:04:42
【问题描述】:

我的代码是:

var query = System.Web.HttpUtility.ParseQueryString(req.RequestUri.Query);
string certificate = = query.Get("issuerCertificate");
byte[] bytes = Encoding.ASCII.GetBytes(certificate);
X509Certificate2 cer = new X509Certificate2(bytes);

提前致谢

【问题讨论】:

  • 您使用的是哪个运行时?
  • 我正在使用 azure 功能。仅限localhost:7071
  • 我只使用 azure function 1.x 版
  • 证书文件是 PFX 吗? Azure Functions 可能没有加载用户配置文件,因此您必须使用 EphemeralKeySet 标志加载它们。

标签: cryptography azure-functions x509certificate2


【解决方案1】:

从查询字符串参数发送证书时,一些空格之间的内部证书在那里。所以我通过添加的应用程序/json删除空格。现在我的证书运行良好。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-11-18
    • 2021-07-08
    • 2016-04-10
    • 2011-07-01
    • 1970-01-01
    • 2012-02-26
    • 1970-01-01
    • 2013-02-09
    相关资源
    最近更新 更多