Show / Hide Table of Contents

    Class WebSecurityUtilityExtensions

    This is an extension implementation of the most common methods on the WebSecurityUtility class.

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

    Methods

    | Improve this Doc

    ToProtectedUri(String, Byte[])

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

    Declaration
    public static Uri ToProtectedUri(this 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

    ToProtectedUri(String, Byte[], SecurityTokenSettings)

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

    Declaration
    public static Uri ToProtectedUri(this 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

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

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

    Declaration
    public static Uri ToProtectedUri(this 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

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

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

    Declaration
    public static Uri ToProtectedUri(this 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

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

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

    Declaration
    public static Uri ToProtectedUri(this 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

    ToProtectedUri(Uri, Byte[])

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

    Declaration
    public static Uri ToProtectedUri(this 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

    ToProtectedUri(Uri, Byte[], SecurityTokenSettings)

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

    Declaration
    public static Uri ToProtectedUri(this 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

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

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

    Declaration
    public static Uri ToProtectedUri(this 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

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

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

    Declaration
    public static Uri ToProtectedUri(this 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

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

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

    Declaration
    public static Uri ToProtectedUri(this 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

    VerifyProtectedUri(Uri, Byte[])

    Parses and verifies the tampering protected URI.

    Declaration
    public static void VerifyProtectedUri(this 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.

    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

    VerifyProtectedUri(Uri, Byte[], String)

    Parses and verifies the tampering protected URI.

    Declaration
    public static void VerifyProtectedUri(this 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.

    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

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

    Parses and verifies the tampering protected URI.

    Declaration
    public static void VerifyProtectedUri(this 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.

    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

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

    Parses and verifies the tampering protected URI.

    Declaration
    public static void VerifyProtectedUri(this 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.

    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

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

    Parses and verifies the tampering protected URI.

    Declaration
    public static void VerifyProtectedUri(this 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.

    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

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

    Parses and verifies the tampering protected URI.

    Declaration
    public static void VerifyProtectedUri(this 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.

    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

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

    Parses and verifies the tampering protected URI.

    Declaration
    public static void VerifyProtectedUri(this 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.

    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