Show / Hide Table of Contents

    Class WebSecurityUtility

    This utility class is designed to make web related security operations easier to work with.

    Inheritance
    System.Object
    WebSecurityUtility
    Namespace: Cuemon.Web.Security
    Assembly: Cuemon.Web.dll
    Syntax
    public static class WebSecurityUtility

    Methods

    | Improve this Doc

    CreateTamperingProtectedUri(String, Byte[])

    Converts the specified uriLocation to a tampering protected System.Uri.

    Declaration
    public static Uri CreateTamperingProtectedUri(string uriLocation, byte[] securityKey)
    Parameters
    Type Name Description
    System.String uriLocation

    The URI to protect from tampering.

    System.Byte[] securityKey

    The security key to use for the SecurityToken encryption.

    Returns
    Type Description
    System.Uri

    An URI equivalent to the uriLocation but protected from tampering - including but not limited to - MITM attacks.

    | Improve this Doc

    CreateTamperingProtectedUri(String, Byte[], SecurityTokenSettings)

    Converts the specified uriLocation to a tampering protected System.Uri.

    Declaration
    public static Uri CreateTamperingProtectedUri(string uriLocation, byte[] securityKey, SecurityTokenSettings settings)
    Parameters
    Type Name Description
    System.String uriLocation

    The URI to protect from tampering.

    System.Byte[] securityKey

    The security key to use for the SecurityToken encryption.

    SecurityTokenSettings settings

    The settings to apply to the SecurityToken.

    Returns
    Type Description
    System.Uri

    An URI equivalent to the uriLocation but protected from tampering - including but not limited to - MITM attacks.

    | Improve this Doc

    CreateTamperingProtectedUri(String, Byte[], SecurityTokenSettings, HashAlgorithmType)

    Converts the specified uriLocation to a tampering protected System.Uri.

    Declaration
    public static Uri CreateTamperingProtectedUri(string uriLocation, byte[] securityKey, SecurityTokenSettings settings, HashAlgorithmType algorithmType)
    Parameters
    Type Name Description
    System.String uriLocation

    The URI to protect from tampering.

    System.Byte[] securityKey

    The security key to use for the SecurityToken encryption.

    SecurityTokenSettings settings

    The settings to apply to the SecurityToken.

    HashAlgorithmType algorithmType

    The hash algorithm to use for the URI checksum computation. Default is SHA1.

    Returns
    Type Description
    System.Uri

    An URI equivalent to the uriLocation but protected from tampering - including but not limited to - MITM attacks.

    | Improve this Doc

    CreateTamperingProtectedUri(String, Byte[], SecurityTokenSettings, HashAlgorithmType, String)

    Converts the specified uriLocation to a tampering protected System.Uri.

    Declaration
    public static Uri CreateTamperingProtectedUri(string uriLocation, byte[] securityKey, SecurityTokenSettings settings, HashAlgorithmType algorithmType, string secureUriFormat)
    Parameters
    Type Name Description
    System.String uriLocation

    The URI to protect from tampering.

    System.Byte[] securityKey

    The security key to use for the SecurityToken encryption.

    SecurityTokenSettings settings

    The settings to apply to the SecurityToken.

    HashAlgorithmType algorithmType

    The hash algorithm to use for the URI checksum computation. Default is SHA1.

    System.String secureUriFormat

    The naming format of the required query string parameters of the tamper protected URI. Default is ?token={0}&iv={1}&salt={2}, where you can change the naming of the query string parameters.

    Returns
    Type Description
    System.Uri

    An URI equivalent to the uriLocation but protected from tampering - including but not limited to - MITM attacks.

    | Improve this Doc

    CreateTamperingProtectedUri(String, Byte[], SecurityTokenSettings, HashAlgorithmType, String, String)

    Converts the specified uriLocation to a tampering protected System.Uri.

    Declaration
    public static Uri CreateTamperingProtectedUri(string uriLocation, byte[] securityKey, SecurityTokenSettings settings, HashAlgorithmType algorithmType, string secureUriFormat, string querystringParameterHashName)
    Parameters
    Type Name Description
    System.String uriLocation

    The URI to protect from tampering.

    System.Byte[] securityKey

    The security key to use for the SecurityToken encryption.

    SecurityTokenSettings settings

    The settings to apply to the SecurityToken.

    HashAlgorithmType algorithmType

    The hash algorithm to use for the URI checksum computation. Default is SHA1.

    System.String secureUriFormat

    The naming format of the required query string parameters of the tamper protected URI. Default is ?token={0}&iv={1}&salt={2}, where you can change the naming of the query string parameters.

    System.String querystringParameterHashName

    The name of the checksum parameter to append to the tampering protected URI. Default is hash.

    Returns
    Type Description
    System.Uri

    An URI equivalent to the uriLocation but protected from tampering - including but not limited to - MITM attacks.

    | Improve this Doc

    CreateTamperingProtectedUri(Uri, Byte[])

    Converts the specified location to a tampering protected System.Uri.

    Declaration
    public static Uri CreateTamperingProtectedUri(Uri location, byte[] securityKey)
    Parameters
    Type Name Description
    System.Uri location

    The URI to protect from tampering.

    System.Byte[] securityKey

    The security key to use for the SecurityToken encryption.

    Returns
    Type Description
    System.Uri

    An URI equivalent to the location but protected from tampering - including but not limited to - MITM attacks.

    | Improve this Doc

    CreateTamperingProtectedUri(Uri, Byte[], SecurityTokenSettings)

    Converts the specified location to a tampering protected System.Uri.

    Declaration
    public static Uri CreateTamperingProtectedUri(Uri location, byte[] securityKey, SecurityTokenSettings settings)
    Parameters
    Type Name Description
    System.Uri location

    The URI to protect from tampering.

    System.Byte[] securityKey

    The security key to use for the SecurityToken encryption.

    SecurityTokenSettings settings

    The settings to apply to the SecurityToken.

    Returns
    Type Description
    System.Uri

    An URI equivalent to the location but protected from tampering - including but not limited to - MITM attacks.

    | Improve this Doc

    CreateTamperingProtectedUri(Uri, Byte[], SecurityTokenSettings, HashAlgorithmType)

    Converts the specified location to a tampering protected System.Uri.

    Declaration
    public static Uri CreateTamperingProtectedUri(Uri location, byte[] securityKey, SecurityTokenSettings settings, HashAlgorithmType algorithmType)
    Parameters
    Type Name Description
    System.Uri location

    The URI to protect from tampering.

    System.Byte[] securityKey

    The security key to use for the SecurityToken encryption.

    SecurityTokenSettings settings

    The settings to apply to the SecurityToken.

    HashAlgorithmType algorithmType

    The hash algorithm to use for the URI checksum computation. Default is SHA1.

    Returns
    Type Description
    System.Uri

    An URI equivalent to the location but protected from tampering - including but not limited to - MITM attacks.

    | Improve this Doc

    CreateTamperingProtectedUri(Uri, Byte[], SecurityTokenSettings, HashAlgorithmType, String)

    Converts the specified location to a tampering protected System.Uri.

    Declaration
    public static Uri CreateTamperingProtectedUri(Uri location, byte[] securityKey, SecurityTokenSettings settings, HashAlgorithmType algorithmType, string secureUriFormat)
    Parameters
    Type Name Description
    System.Uri location

    The URI to protect from tampering.

    System.Byte[] securityKey

    The security key to use for the SecurityToken encryption.

    SecurityTokenSettings settings

    The settings to apply to the SecurityToken.

    HashAlgorithmType algorithmType

    The hash algorithm to use for the URI checksum computation. Default is SHA1.

    System.String secureUriFormat

    The naming format of the required query string parameters of the tamper protected URI. Default is ?token={0}&iv={1}&salt={2}, where you can change the naming of the query string parameters.

    Returns
    Type Description
    System.Uri

    An URI equivalent to the location but protected from tampering - including but not limited to - MITM attacks.

    | Improve this Doc

    CreateTamperingProtectedUri(Uri, Byte[], SecurityTokenSettings, HashAlgorithmType, String, String)

    Converts the specified location to a tampering protected System.Uri.

    Declaration
    public static Uri CreateTamperingProtectedUri(Uri location, byte[] securityKey, SecurityTokenSettings settings, HashAlgorithmType algorithmType, string secureUriFormat, string querystringParameterHashName)
    Parameters
    Type Name Description
    System.Uri location

    The URI to protect from tampering.

    System.Byte[] securityKey

    The security key to use for the SecurityToken encryption.

    SecurityTokenSettings settings

    The settings to apply to the SecurityToken.

    HashAlgorithmType algorithmType

    The hash algorithm to use for the URI checksum computation. Default is SHA1.

    System.String secureUriFormat

    The naming format of the required query string parameters of the tamper protected URI. Default is ?token={0}&iv={1}&salt={2}, where you can change the naming of the query string parameters.

    System.String querystringParameterHashName

    The name of the checksum parameter to append to the tampering protected URI. Default is hash.

    Returns
    Type Description
    System.Uri

    An URI equivalent to the location but protected from tampering - including but not limited to - MITM attacks.

    | Improve this Doc

    ParseTamperingProtectedUri(Uri, Byte[])

    Parses and verifies the tampering protected URI.

    Declaration
    public static SecurityToken ParseTamperingProtectedUri(Uri protectedUri, byte[] securityKey)
    Parameters
    Type Name Description
    System.Uri protectedUri

    The tampering protected URI.

    System.Byte[] securityKey

    The security key to use in the decryption of a SecurityToken.

    Returns
    Type Description
    SecurityToken

    An instance of the SecurityToken object if the protectedUri is valid.

    Exceptions
    Type Condition
    System.Security.SecurityException

    This exception is thrown when an unsucessfull parse is meet, hence values has been tampered with, protectedUri is invalid, token has expired or one or more of the necessary parameters is missing.

    | Improve this Doc

    ParseTamperingProtectedUri(Uri, Byte[], String)

    Parses and verifies the tampering protected URI.

    Declaration
    public static SecurityToken ParseTamperingProtectedUri(Uri protectedUri, byte[] securityKey, string token)
    Parameters
    Type Name Description
    System.Uri protectedUri

    The tampering protected URI.

    System.Byte[] securityKey

    The security key to use in the decryption of the token.

    System.String token

    The security token to decrypt and parse for a SecurityToken.

    Returns
    Type Description
    SecurityToken

    An instance of the SecurityToken object if the protectedUri is valid.

    Exceptions
    Type Condition
    System.Security.SecurityException

    This exception is thrown when an unsucessfull parse is meet, hence values has been tampered with, protectedUri is invalid, token has expired or one or more of the necessary parameters is missing.

    | Improve this Doc

    ParseTamperingProtectedUri(Uri, Byte[], String, String)

    Parses and verifies the tampering protected URI.

    Declaration
    public static SecurityToken ParseTamperingProtectedUri(Uri protectedUri, byte[] securityKey, string token, string iv)
    Parameters
    Type Name Description
    System.Uri protectedUri

    The tampering protected URI.

    System.Byte[] securityKey

    The security key to use in the decryption of the token.

    System.String token

    The security token to decrypt and parse for a SecurityToken.

    System.String iv

    The initialization vector (IV) to use in the decryption of the token.

    Returns
    Type Description
    SecurityToken

    An instance of the SecurityToken object if the protectedUri is valid.

    Exceptions
    Type Condition
    System.Security.SecurityException

    This exception is thrown when an unsucessfull parse is meet, hence values has been tampered with, protectedUri is invalid, token has expired or one or more of the necessary parameters is missing.

    | Improve this Doc

    ParseTamperingProtectedUri(Uri, Byte[], String, String, String)

    Parses and verifies the tampering protected URI.

    Declaration
    public static SecurityToken ParseTamperingProtectedUri(Uri protectedUri, byte[] securityKey, string token, string iv, string salt)
    Parameters
    Type Name Description
    System.Uri protectedUri

    The tampering protected URI.

    System.Byte[] securityKey

    The security key to use in the decryption of the token.

    System.String token

    The security token to decrypt and parse for a SecurityToken.

    System.String iv

    The initialization vector (IV) to use in the decryption of the token.

    System.String salt

    The salt used in the computation of the integrity verification of protectedUri.

    Returns
    Type Description
    SecurityToken

    An instance of the SecurityToken object if the protectedUri is valid.

    Exceptions
    Type Condition
    System.Security.SecurityException

    This exception is thrown when an unsucessfull parse is meet, hence values has been tampered with, protectedUri is invalid, token has expired or one or more of the necessary parameters is missing.

    | Improve this Doc

    ParseTamperingProtectedUri(Uri, Byte[], String, String, String, String)

    Parses and verifies the tampering protected URI.

    Declaration
    public static SecurityToken ParseTamperingProtectedUri(Uri protectedUri, byte[] securityKey, string token, string iv, string salt, string hash)
    Parameters
    Type Name Description
    System.Uri protectedUri

    The tampering protected URI.

    System.Byte[] securityKey

    The security key to use in the decryption of the token.

    System.String token

    The security token to decrypt and parse for a SecurityToken.

    System.String iv

    The initialization vector (IV) to use in the decryption of the token.

    System.String salt

    The salt used in the computation of the integrity verification of protectedUri.

    System.String hash

    The checksum to verify the integrity of protectedUri.

    Returns
    Type Description
    SecurityToken

    An instance of the SecurityToken object if the protectedUri is valid.

    Exceptions
    Type Condition
    System.Security.SecurityException

    This exception is thrown when an unsucessfull parse is meet, hence values has been tampered with, protectedUri is invalid, token has expired or one or more of the necessary parameters is missing.

    | Improve this Doc

    ParseTamperingProtectedUri(Uri, Byte[], String, String, String, String, HashAlgorithmType)

    Parses and verifies the tampering protected URI.

    Declaration
    public static SecurityToken ParseTamperingProtectedUri(Uri protectedUri, byte[] securityKey, string token, string iv, string salt, string hash, HashAlgorithmType algorithmType)
    Parameters
    Type Name Description
    System.Uri protectedUri

    The tampering protected URI.

    System.Byte[] securityKey

    The security key to use in the decryption of the token.

    System.String token

    The security token to decrypt and parse for a SecurityToken.

    System.String iv

    The initialization vector (IV) to use in the decryption of the token.

    System.String salt

    The salt used in the computation of the integrity verification of protectedUri.

    System.String hash

    The checksum to verify the integrity of protectedUri.

    HashAlgorithmType algorithmType

    The hash algorithm to use for the protectedUri checksum computation. Default is SHA1.

    Returns
    Type Description
    SecurityToken

    An instance of the SecurityToken object if the protectedUri is valid.

    Exceptions
    Type Condition
    System.Security.SecurityException

    This exception is thrown when an unsucessfull parse is meet, hence values has been tampered with, protectedUri is invalid, token has expired or one or more of the necessary parameters is missing.

    | Improve this Doc

    ParseTamperingProtectedUri(Uri, Byte[], String, String, String, String, HashAlgorithmType, String)

    Parses and verifies the tampering protected URI.

    Declaration
    public static SecurityToken ParseTamperingProtectedUri(Uri protectedUri, byte[] securityKey, string token, string iv, string salt, string hash, HashAlgorithmType algorithmType, string querystringParameterHashName)
    Parameters
    Type Name Description
    System.Uri protectedUri

    The tampering protected URI.

    System.Byte[] securityKey

    The security key to use in the decryption of the token.

    System.String token

    The security token to decrypt and parse for a SecurityToken.

    System.String iv

    The initialization vector (IV) to use in the decryption of the token.

    System.String salt

    The salt used in the computation of the integrity verification of protectedUri.

    System.String hash

    The checksum to verify the integrity of protectedUri.

    HashAlgorithmType algorithmType

    The hash algorithm to use for the protectedUri checksum computation. Default is SHA1.

    System.String querystringParameterHashName

    The name of the checksum parameter to remove from the protectedUri before integrity verification. Default is hash.

    Returns
    Type Description
    SecurityToken

    An instance of the SecurityToken object if the protectedUri is valid.

    Exceptions
    Type Condition
    System.Security.SecurityException

    This exception is thrown when an unsucessfull parse is meet, hence values has been tampered with, protectedUri is invalid, token has expired or one or more of the necessary parameters is missing.

    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX