1 // This may look like C code, but it's really -*- C++ -*-
2 /*
3  * Copyright (C) 2011 Emweb bv, Herent, Belgium.
4  *
5  * See the LICENSE file for terms of use.
6  */
7 
8 #ifndef WT_AUTH_UTILS_H_
9 #define WT_AUTH_UTILS_H_
10 
11 #include <string>
12 #include <Wt/WDllDefs.h>
13 
14 namespace Wt {
15   namespace Auth {
16     namespace Utils {
17       WT_API extern std::string createSalt(unsigned int length);
18 
19       // decodeAscii(encodeAscii(a)) == a only if
20       // its length multiple of 3 bytes
21       WT_API extern std::string encodeAscii(const std::string& a);
22       WT_API extern std::string decodeAscii(const std::string& a);
23 
24       extern std::string encodeState(const std::string &secret, const std::string &url);
25       extern std::string decodeState(const std::string &secret, const std::string &state);
26 
27       extern std::string configurationProperty(const std::string &prefix,
28                                                const std::string &property);
29     }
30   }
31 }
32 
33 #endif // WT_AUTH_UTILS_H_
34