Class ContentSecurityPolicy
Provides helper methods for content security policy.
Inheritance
System.Object
ContentSecurityPolicy
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: ComponentSpace.SAML2.Utility
Assembly: ComponentSpace.Saml2.dll
Syntax
public static class ContentSecurityPolicy
Methods
CreateHashedScriptSource(String)
Creates a SHA-256 hashed script source for inclusion in a Content-Security-Policy header.
Declaration
public static string CreateHashedScriptSource(string script)
Parameters
Type | Name | Description |
---|---|---|
System.String | script | The script |
Returns
Type | Description |
---|---|
System.String | The hashed script source. |
GetScript(String)
Gets the JavaScript contained within HTML.
Declaration
public static string GetScript(string html)
Parameters
Type | Name | Description |
---|---|---|
System.String | html | The HTML. |
Returns
Type | Description |
---|---|
System.String | The JavaScript contained within the script tags. |
HashScript(String)
Returns the SHA-256 hash of the JavaScript.
Declaration
public static string HashScript(string script)
Parameters
Type | Name | Description |
---|---|---|
System.String | script | The script. |
Returns
Type | Description |
---|---|
System.String | The hash of the script. |