]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
glib-2.0: add Hmac bindings
authorPhilip Flarsheim <philip.flarsheim@gmail.com>
Sat, 5 May 2012 03:33:10 +0000 (20:33 -0700)
committerJürg Billeter <j@bitron.ch>
Sat, 23 Jun 2012 15:18:55 +0000 (17:18 +0200)
Fixes bug 670243.

vapi/glib-2.0.vapi

index df6ebf32e38022890d5293a0df9a5dccdd7e56a0..cd4aa17d912bdaf77501a933c1934e5c7f606207 100644 (file)
@@ -2368,6 +2368,22 @@ namespace GLib {
                public static string compute_for_string (ChecksumType checksum_type, string str, size_t length = -1);
        }
 
+       /* Secure HMAC Digests */
+
+       [Compact]
+       [CCode (ref_function = "g_hmac_ref", unref_function = "g_hmac_unref")]
+       public class Hmac {
+               public Hmac (ChecksumType digest_type, [CCode (array_length_type = "gsize")] uint8[] key);
+               public Hmac copy ();
+               public void update ([CCode (array_length_type = "gssize")] uint8[] data, size_t length);
+               public unowned string get_string ();
+               public void get_digest ([CCode (array_length = false)] uint8[] buffer, ref size_t digest_len);
+               [CCode (cname = "g_compute_hmac_for_data")]
+               public static string compute_for_data (ChecksumType checksum_type, uint8[] key, uint8[] data);
+               [CCode (cname = "g_compute_hmac_for_string")]
+               public static string compute_for_string (ChecksumType checksum_type, uint8[] key, string str, size_t length = -1);
+       }
+
        /* Date and Time Functions */
 
        [CCode (has_type_id = false)]