Interface IContentSecurityPolicyInlineExecutionFeature
Provides support for inline execution aspects of Content Security Policy.
Namespace: Lib.AspNetCore.Security.Http.Features
Assembly: Lib.AspNetCore.Security.dll
Syntax
public interface IContentSecurityPolicyInlineExecutionFeature
Properties
Nonce
Gets the nonce for Nonce.
Declaration
string Nonce { get; }
Property Value
Type | Description |
---|---|
System.String |
ScriptInlineExecution
Gets the inline execution mode for scripts.
Declaration
ContentSecurityPolicyInlineExecution ScriptInlineExecution { get; }
Property Value
Type | Description |
---|---|
ContentSecurityPolicyInlineExecution |
ScriptsHashes
Gets the scripts hashes collection for Hash.
Declaration
ICollection<string> ScriptsHashes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<System.String> |
StyleInlineExecution
Gets the inline execution mode for stylesheets.
Declaration
ContentSecurityPolicyInlineExecution StyleInlineExecution { get; }
Property Value
Type | Description |
---|---|
ContentSecurityPolicyInlineExecution |
StylesHashes
Gets the styles hashes collection for Hash.
Declaration
ICollection<string> StylesHashes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<System.String> |
Methods
AddHashToCache(String, String)
Adds the hash to cache.
Declaration
void AddHashToCache(string cacheKey, string hash)
Parameters
Type | Name | Description |
---|---|---|
System.String | cacheKey | The cache key. |
System.String | hash | The hash. |
ComputeHash(ContentSecurityPolicyInlineExecution, String)
Computes the hash for given content.
Declaration
string ComputeHash(ContentSecurityPolicyInlineExecution hashAlgorithm, string elementContent)
Parameters
Type | Name | Description |
---|---|---|
ContentSecurityPolicyInlineExecution | hashAlgorithm | The algorithm for computing the hash. |
System.String | elementContent | The content for which the hash is to be computed. |
Returns
Type | Description |
---|---|
System.String | The hash. |
GetHashFromCache(String)
Gets the hash from cache.
Declaration
string GetHashFromCache(string cacheKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | cacheKey | The cache key. |
Returns
Type | Description |
---|---|
System.String | The hash. |