Exemplo n.º 1
0
 /// <summary>
 /// The string to pass as the assoc_type value in the OpenID protocol.
 /// </summary>
 /// <param name="protocol">The protocol version of the message that the assoc_type value will be included in.</param>
 /// <returns>The value that should be used for  the openid.assoc_type parameter.</returns>
 internal abstract string GetAssociationType(Protocol protocol);
Exemplo n.º 2
0
 /// <summary>
 /// Gets the OpenID protocol instance for the version in a message.
 /// </summary>
 /// <param name="message">The message.</param>
 /// <returns>The OpenID protocol instance.</returns>
 internal static Protocol GetProtocol(this IProtocolMessage message)
 {
     Requires.NotNull(message, "message");
     return(Protocol.Lookup(message.Version));
 }
Exemplo n.º 3
0
        /// <summary>
        /// Determines whether a named association fits the security requirements.
        /// </summary>
        /// <param name="protocol">The protocol carrying the association.</param>
        /// <param name="associationType">The value of the openid.assoc_type parameter.</param>
        /// <returns>
        ///     <c>true</c> if the association is permitted given the security requirements; otherwise, <c>false</c>.
        /// </returns>
        internal bool IsAssociationInPermittedRange(Protocol protocol, string associationType)
        {
            int lengthInBits = HmacShaAssociation.GetSecretLength(protocol, associationType) * 8;

            return(lengthInBits >= this.MinimumHashBitLength && lengthInBits <= this.MaximumHashBitLength);
        }