Interface IHmacSecretKeyService
Used to get and create the imaging HMAC secret key.
Namespace: Umbraco.Cms.Core.Security
Assembly: Umbraco.Core.dll
Syntax
public interface IHmacSecretKeyService
Methods
View SourceCreateHmacSecretKeyAsync()
Generates a new cryptographic HMAC secret key and persists it to the configuration file if one is not already configured. No-ops when a key already exists to avoid rotating the key and invalidating previously generated signed URLs.
Declaration
Task<Attempt<HmacSecretKeyOperationStatus>> CreateHmacSecretKeyAsync()
Returns
| Type | Description |
|---|---|
| Task<Attempt<HmacSecretKeyOperationStatus>> | An Attempt<TResult> with status Success if the key was generated and persisted, KeyExists if a key already exists, or Error if persistence failed. |
HasHmacSecretKey()
Checks whether a non-empty HMAC secret key is configured.
Declaration
bool HasHmacSecretKey()
Returns
| Type | Description |
|---|---|
| bool |