-rw-r--r-- | include/opkele/util.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/opkele/util.h b/include/opkele/util.h index 60955e1..fd974a1 100644 --- a/include/opkele/util.h +++ b/include/opkele/util.h | |||
@@ -39,76 +39,78 @@ namespace opkele { | |||
39 | string url_encode(const string& str); | 39 | string url_encode(const string& str); |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * Make string suitable for using as x(ht)ml attribute. | 42 | * Make string suitable for using as x(ht)ml attribute. |
43 | * @param str string to escape | 43 | * @param str string to escape |
44 | * @return escaped string | 44 | * @return escaped string |
45 | */ | 45 | */ |
46 | string attr_escape(const string& str); | 46 | string attr_escape(const string& str); |
47 | 47 | ||
48 | /** | 48 | /** |
49 | * Convert number to string | 49 | * Convert number to string |
50 | * @param l number | 50 | * @param l number |
51 | * @return string representation | 51 | * @return string representation |
52 | * @throw failed_conversion in case of failure | 52 | * @throw failed_conversion in case of failure |
53 | */ | 53 | */ |
54 | string long_to_string(long l); | 54 | string long_to_string(long l); |
55 | /** | 55 | /** |
56 | * Convert string to number | 56 | * Convert string to number |
57 | * @param s string, containing the number | 57 | * @param s string, containing the number |
58 | * @return the number | 58 | * @return the number |
59 | * @throw failed_conversion in case of failure | 59 | * @throw failed_conversion in case of failure |
60 | */ | 60 | */ |
61 | long string_to_long(const string& s); | 61 | long string_to_long(const string& s); |
62 | 62 | ||
63 | /** | 63 | /** |
64 | * Encode binary data using base64. | 64 | * Encode binary data using base64. |
65 | * @param data pointer to binary data | 65 | * @param data pointer to binary data |
66 | * @param length length of data | 66 | * @param length length of data |
67 | * @return encoded data | 67 | * @return encoded data |
68 | */ | 68 | */ |
69 | string encode_base64(const void *data,size_t length); | 69 | string encode_base64(const void *data,size_t length); |
70 | /** | 70 | /** |
71 | * Decode binary data from base64 representation. | 71 | * Decode binary data from base64 representation. |
72 | * @param data base64-encoded data | 72 | * @param data base64-encoded data |
73 | * @param rv container for decoded binary | 73 | * @param rv container for decoded binary |
74 | */ | 74 | */ |
75 | void decode_base64(const string& data,vector<unsigned char>& rv); | 75 | void decode_base64(const string& data,vector<unsigned char>& rv); |
76 | 76 | ||
77 | /** | 77 | /** |
78 | * Normalize http(s) URI according to RFC3986, section 6. URI is | 78 | * Normalize http(s) URI according to RFC3986, section 6. URI is |
79 | * expected to have scheme: in front of it. | 79 | * expected to have scheme: in front of it. |
80 | * @param uri URI | 80 | * @param uri URI |
81 | * @return normalized URI | 81 | * @return normalized URI |
82 | * @throw not_implemented in case of non-httpi(s) URI | 82 | * @throw not_implemented in case of non-httpi(s) URI |
83 | * @throw bad_input in case of malformed URI | 83 | * @throw bad_input in case of malformed URI |
84 | */ | 84 | */ |
85 | string rfc_3986_normalize_uri(const string& uri); | 85 | string rfc_3986_normalize_uri(const string& uri); |
86 | 86 | ||
87 | string normalize_identifier(const string& usi,bool strip_fragment); | ||
88 | |||
87 | /** | 89 | /** |
88 | * Match URI against realm | 90 | * Match URI against realm |
89 | * @param uri URI to match | 91 | * @param uri URI to match |
90 | * @param realm realm to match against | 92 | * @param realm realm to match against |
91 | * @return true if URI matches realm | 93 | * @return true if URI matches realm |
92 | */ | 94 | */ |
93 | bool uri_matches_realm(const string& uri,const string& realm); | 95 | bool uri_matches_realm(const string& uri,const string& realm); |
94 | 96 | ||
95 | /** | 97 | /** |
96 | * Strip fragment part from URI | 98 | * Strip fragment part from URI |
97 | * @param uri input/output parameter containing the URI | 99 | * @param uri input/output parameter containing the URI |
98 | * @return reference to uri | 100 | * @return reference to uri |
99 | */ | 101 | */ |
100 | string& strip_uri_fragment_part(string& uri); | 102 | string& strip_uri_fragment_part(string& uri); |
101 | 103 | ||
102 | /** | 104 | /** |
103 | * Calculate signature and encode it using base64 | 105 | * Calculate signature and encode it using base64 |
104 | * @param assoc association being used for signing | 106 | * @param assoc association being used for signing |
105 | * @param om openid message | 107 | * @param om openid message |
106 | * @return base64 representation of the signature | 108 | * @return base64 representation of the signature |
107 | */ | 109 | */ |
108 | string base64_signature(const assoc_t& assoc,const basic_openid_message& om); | 110 | string base64_signature(const assoc_t& assoc,const basic_openid_message& om); |
109 | 111 | ||
110 | } | 112 | } |
111 | 113 | ||
112 | } | 114 | } |
113 | 115 | ||
114 | #endif /* __OPKELE_UTIL_H */ | 116 | #endif /* __OPKELE_UTIL_H */ |