/// <summary>
        /// Sets the authentication key to be used in the session establishment.
        /// </summary>
        /// <param name="key">The authentication key.</param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException"></exception>
        public IEstablishedClientChannelBuilder WithKeyAuthentication(string key)
        {
            Guard.Argument(key, nameof(key)).NotNull();

            var authentication = new KeyAuthentication();

            authentication.SetToBase64Key(key);
            return(WithAuthentication(authentication));
        }
        /// <summary>
        /// Sets the authentication key to be used in the session establishment.
        /// </summary>
        /// <param name="key">The authentication key.</param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException"></exception>
        public EstablishedClientChannelBuilder WithKeyAuthentication(string key)
        {
            if (key == null)
            {
                throw new ArgumentNullException(nameof(key));
            }
            var authentication = new KeyAuthentication();

            authentication.SetToBase64Key(key);
            return(WithAuthentication(authentication));
        }