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 參考。