DataProtectionBuilderExtensions.ProtectKeysWithCertificate 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
ProtectKeysWithCertificate(IDataProtectionBuilder, X509Certificate2) |
将密钥配置为在保存到存储之前加密到给定证书。 |
ProtectKeysWithCertificate(IDataProtectionBuilder, String) |
将密钥配置为在保存到存储之前加密到给定证书。 |
ProtectKeysWithCertificate(IDataProtectionBuilder, X509Certificate2)
将密钥配置为在保存到存储之前加密到给定证书。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::DataProtection::IDataProtectionBuilder ^ ProtectKeysWithCertificate(Microsoft::AspNetCore::DataProtection::IDataProtectionBuilder ^ builder, System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate);
public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder ProtectKeysWithCertificate (this Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder builder, System.Security.Cryptography.X509Certificates.X509Certificate2 certificate);
static member ProtectKeysWithCertificate : Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder * System.Security.Cryptography.X509Certificates.X509Certificate2 -> Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder
<Extension()>
Public Function ProtectKeysWithCertificate (builder As IDataProtectionBuilder, certificate As X509Certificate2) As IDataProtectionBuilder
参数
- certificate
- X509Certificate2
加密密钥时要使用的证书。
返回
此操作完成后对 IDataProtectionBuilder 的引用。
适用于
ProtectKeysWithCertificate(IDataProtectionBuilder, String)
将密钥配置为在保存到存储之前加密到给定证书。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::DataProtection::IDataProtectionBuilder ^ ProtectKeysWithCertificate(Microsoft::AspNetCore::DataProtection::IDataProtectionBuilder ^ builder, System::String ^ thumbprint);
public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder ProtectKeysWithCertificate (this Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder builder, string thumbprint);
static member ProtectKeysWithCertificate : Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder * string -> Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder
<Extension()>
Public Function ProtectKeysWithCertificate (builder As IDataProtectionBuilder, thumbprint As String) As IDataProtectionBuilder
参数
- thumbprint
- String
加密密钥时要使用的证书的指纹。
返回
此操作完成后对 IDataProtectionBuilder 的引用。