示例#1
0
        /// <summary>
        /// Looks up the value to be used for the openid.session_type parameter.
        /// </summary>
        /// <param name="protocol">The protocol version that is to be used.</param>
        /// <param name="hashSizeInBits">The hash size (in bits) that the DH session must have.</param>
        /// <returns>The value to be used for the openid.session_type parameter, or null if no match was found.</returns>
        internal static string GetNameForSize(Protocol protocol, int hashSizeInBits)
        {
            Requires.NotNull(protocol, "protocol");
            DHSha match = diffieHellmanSessionTypes.FirstOrDefault(dhsha => dhsha.Algorithm.HashSize == hashSizeInBits);

            return(match != null?match.GetName(protocol) : null);
        }
        /// <summary>
        /// Looks up the value to be used for the openid.session_type parameter.
        /// </summary>
        /// <param name="protocol">The protocol version that is to be used.</param>
        /// <param name="hashSizeInBits">The hash size (in bits) that the DH session must have.</param>
        /// <returns>The value to be used for the openid.session_type parameter, or null if no match was found.</returns>
        internal static string GetNameForSize(Protocol protocol, int hashSizeInBits)
        {
            Contract.Requires <ArgumentNullException>(protocol != null);
            DHSha match = diffieHellmanSessionTypes.FirstOrDefault(dhsha => dhsha.Algorithm.HashSize == hashSizeInBits);

            return(match != null?match.GetName(protocol) : null);
        }