/// <summary> /// Determines whether the association with the specified handle is (still) valid. /// </summary> /// <param name="associationStore">The association store.</param> /// <param name="containingMessage">The OpenID message that referenced this association handle.</param> /// <param name="isPrivateAssociation">A value indicating whether a private association is expected.</param> /// <param name="handle">The association handle.</param> /// <returns> /// <c>true</c> if the specified containing message is valid; otherwise, <c>false</c>. /// </returns> internal static bool IsValid(this IProviderAssociationStore associationStore, IProtocolMessage containingMessage, bool isPrivateAssociation, string handle) { Requires.NotNull(associationStore, "associationStore"); Requires.NotNull(containingMessage, "containingMessage"); Requires.NotNullOrEmpty(handle, "handle"); try { return(associationStore.Deserialize(containingMessage, isPrivateAssociation, handle) != null); } catch (ProtocolException) { return(false); } }