Dela via


SqlColumnEncryptionKeyStoreProvider.ColumnEncryptionKeyCacheTtl Property

Definition

Gets or sets the lifespan of the decrypted column encryption key in the cache. Once the timespan has elapsed, the decrypted column encryption key is discarded and must be revalidated.

public:
 virtual property Nullable<TimeSpan> ColumnEncryptionKeyCacheTtl { Nullable<TimeSpan> get(); void set(Nullable<TimeSpan> value); };
public virtual TimeSpan? ColumnEncryptionKeyCacheTtl { get; set; }
member this.ColumnEncryptionKeyCacheTtl : Nullable<TimeSpan> with get, set
Public Overridable Property ColumnEncryptionKeyCacheTtl As Nullable(Of TimeSpan)

Property Value

Remarks

Internally, there is a cache of column encryption keys (once they are decrypted). This is useful for rapidly decrypting multiple data values. The default value is 2 hours. Setting this value to zero disables caching.

The column encryption keys decrypted by custom key store providers registered on a connection or command instance will not be cached. Custom key store providers should implement their own caching mechanism.

Caching implemented by custom key store providers will be disabled by the driver if the key store provider instance is registered using RegisterColumnEncryptionKeyStoreProviders(IDictionary<String,SqlColumnEncryptionKeyStoreProvider>). Any caching implementation should reference the value of this property before caching a column encryption key and not cache it if the value is zero. This will avoid duplicate caching and possible user confusion when they are trying to configure key caching.

Applies to