【问题标题】:ProtectKeysWithCertificate Method not found in asp.net core DataProtection api在 asp.net 核心 DataProtection api 中找不到 ProtectKeysWithCertificate 方法
【发布时间】:2017-12-14 08:06:57
【问题描述】:

添加 ProtectKeysWithCertificate 这一行时出现编译时错误

public IServiceProvider ConfigureServices(IServiceCollection services)
{
    services.AddDataProtection()
        .SetApplicationName("Testervice")
        .ProtectKeysWithCertificate(newCert);
        //compile time error on ProtectKeysWithCertificate line
       //method not found
}

【问题讨论】:

    标签: c# asp.net asp.net-core openiddict


    【解决方案1】:

    in the documentation 所示,ProtectKeysWithCertificate() 在 .NET Core 1.0/1.1 (netcoreapp1.x) 上不可用。

    如果您想使用它,可以针对完整的 .NET Framework(例如 net461)。

    【讨论】:

    • System.Security.Cryptography.CryptographicException: is not found in the key ring got error
    猜你喜欢
    • 1970-01-01
    • 2016-11-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-31
    • 1970-01-01
    • 2019-09-17
    • 1970-01-01
    相关资源
    最近更新 更多