Example #1
0
 /// <summary>
 /// Converts the specified <paramref name="uriLocation"/> to a tampering protected <see cref="Uri"/>.
 /// </summary>
 /// <param name="uriLocation">The URI to protect from tampering.</param>
 /// <param name="securityKey">The security key to use for the <see cref="SecurityToken"/> encryption.</param>
 /// <param name="settings">The settings to apply to the <see cref="SecurityToken"/>.</param>
 /// <returns>An URI equivalent to the <paramref name="uriLocation"/> but protected from tampering - including but not limited to - MITM attacks.</returns>
 public static Uri ToProtectedUri(this string uriLocation, byte[] securityKey, SecurityTokenSettings settings)
 {
     return(WebSecurityUtility.CreateTamperingProtectedUri(uriLocation, securityKey, settings));
 }
Example #2
0
 /// <summary>
 /// Converts the specified <paramref name="location"/> to a tampering protected <see cref="Uri"/>.
 /// </summary>
 /// <param name="location">The URI to protect from tampering.</param>
 /// <param name="securityKey">The security key to use for the <see cref="SecurityToken"/> encryption.</param>
 /// <param name="settings">The settings to apply to the <see cref="SecurityToken"/>.</param>
 /// <param name="algorithmType">The hash algorithm to use for the URI checksum computation. Default is <b><see cref="HashAlgorithmType.SHA1"/></b>.</param>
 /// <param name="secureUriFormat">The naming format of the required query string parameters of the tamper protected URI. Default is <b>?token={0}&amp;iv={1}&amp;salt={2}</b>, where you can change the naming of the query string parameters.</param>
 /// <param name="querystringParameterHashName">The name of the checksum parameter to append to the tampering protected URI. Default is <b>hash</b>.</param>
 /// <returns>An URI equivalent to the <paramref name="location"/> but protected from tampering - including but not limited to - MITM attacks.</returns>
 public static Uri ToProtectedUri(this Uri location, byte[] securityKey, SecurityTokenSettings settings, HashAlgorithmType algorithmType, string secureUriFormat, string querystringParameterHashName)
 {
     return(WebSecurityUtility.CreateTamperingProtectedUri(location, securityKey, settings, algorithmType, secureUriFormat, querystringParameterHashName));
 }
Example #3
0
 /// <summary>
 /// Converts the specified <paramref name="location"/> to a tampering protected <see cref="Uri"/>.
 /// </summary>
 /// <param name="location">The URI to protect from tampering.</param>
 /// <param name="securityKey">The security key to use for the <see cref="SecurityToken"/> encryption.</param>
 /// <returns>An URI equivalent to the <paramref name="location"/> but protected from tampering - including but not limited to - MITM attacks.</returns>
 public static Uri ToProtectedUri(this Uri location, byte[] securityKey)
 {
     return(WebSecurityUtility.CreateTamperingProtectedUri(location, securityKey));
 }
Example #4
0
 /// <summary>
 /// Converts the specified <paramref name="location"/> to a tampering protected <see cref="Uri"/>.
 /// </summary>
 /// <param name="location">The URI to protect from tampering.</param>
 /// <param name="securityKey">The security key to use for the <see cref="SecurityToken"/> encryption.</param>
 /// <param name="settings">The settings to apply to the <see cref="SecurityToken"/>.</param>
 /// <param name="algorithmType">The hash algorithm to use for the URI checksum computation. Default is <b><see cref="HashAlgorithmType.SHA1"/></b>.</param>
 /// <returns>An URI equivalent to the <paramref name="location"/> but protected from tampering - including but not limited to - MITM attacks.</returns>
 public static Uri ToProtectedUri(this Uri location, byte[] securityKey, SecurityTokenSettings settings, HashAlgorithmType algorithmType)
 {
     return(WebSecurityUtility.CreateTamperingProtectedUri(location, securityKey, settings, algorithmType));
 }
Example #5
0
 /// <summary>
 /// Converts the specified <paramref name="uriLocation"/> to a tampering protected <see cref="Uri"/>.
 /// </summary>
 /// <param name="uriLocation">The URI to protect from tampering.</param>
 /// <param name="securityKey">The security key to use for the <see cref="SecurityToken"/> encryption.</param>
 /// <param name="settings">The settings to apply to the <see cref="SecurityToken"/>.</param>
 /// <param name="algorithmType">The hash algorithm to use for the URI checksum computation. Default is <b><see cref="HashAlgorithmType.SHA1"/></b>.</param>
 /// <param name="secureUriFormat">The naming format of the required query string parameters of the tamper protected URI. Default is <b>?token={0}&amp;iv={1}&amp;salt={2}</b>, where you can change the naming of the query string parameters.</param>
 /// <returns>An URI equivalent to the <paramref name="uriLocation"/> but protected from tampering - including but not limited to - MITM attacks.</returns>
 public static Uri ToProtectedUri(this string uriLocation, byte[] securityKey, SecurityTokenSettings settings, HashAlgorithmType algorithmType, string secureUriFormat)
 {
     return(WebSecurityUtility.CreateTamperingProtectedUri(uriLocation, securityKey, settings, algorithmType, secureUriFormat));
 }