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 的引用。

适用于