共用方式為


DataProtectionBuilderExtensions.SetDefaultKeyLifetime 方法

定義

設定資料保護系統所建立金鑰的預設存留期。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::DataProtection::IDataProtectionBuilder ^ SetDefaultKeyLifetime(Microsoft::AspNetCore::DataProtection::IDataProtectionBuilder ^ builder, TimeSpan lifetime);
public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder SetDefaultKeyLifetime (this Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder builder, TimeSpan lifetime);
static member SetDefaultKeyLifetime : Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder * TimeSpan -> Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder
<Extension()>
Public Function SetDefaultKeyLifetime (builder As IDataProtectionBuilder, lifetime As TimeSpan) As IDataProtectionBuilder

參數

lifetime
TimeSpan

新建立金鑰到期前的存留期 (時間) 。 如需詳細資訊和使用注意事項,請參閱 NewKeyLifetime

傳回

此作業完成之後的 IDataProtectionBuilder 參考。

適用於