public static byte[] FromBase64StringNoPadding(this String base64String)
        {
            ArgumentUtility.CheckStringForNullOrEmpty(base64String, "base64String");

            string s = base64String;

            s = s.Replace('-', '+');  // 62nd char of encoding
            s = s.Replace('_', '/');  // 63rd char of encoding
            switch (s.Length % 4)     // Pad with trailing '='s
            {
            case 0: break;            // No pad chars in this case

            case 2: s += "=="; break; // Two pad chars

            case 3: s += "="; break;  // One pad char

            default:
                throw new ArgumentException(CommonResources.IllegalBase64String(), "base64String");
            }
            return(Convert.FromBase64String(s)); // Standard base64 decoder
        }