public static AuthenticationToken Unprotect(string protectedToken)
        {
            try
            {
                if (protectedToken.IsNullOrWhiteSpace())
                {
                    return(null);
                }

                byte[] protectedBuffer = SimpleBase64UrlSafeTextEncoder.Decode(protectedToken);
                if (protectedBuffer == null)
                {
                    return(null);
                }

                byte[] buffer = Decrpyt(protectedBuffer);
                if (buffer == null)
                {
                    return(null);
                }

                return(AuthenticationTokenSerializer.Deserialize(buffer));
            }
            catch
            {
                throw new Exception("Failed to unprotect authentication token. This will require some debugging...");
            }
        }
 public static string Protect(AuthenticationToken token)
 {
     byte[] buffer          = AuthenticationTokenSerializer.Serialize(token);
     byte[] protectedBuffer = Encrpyt(buffer);
     return(SimpleBase64UrlSafeTextEncoder.Encode(protectedBuffer));
 }