Imported Upstream version 2.34.0
[platform/upstream/glib-networking.git] / tls / pkcs11 / gpkcs11pin.h
1 /* GIO - GLib Pin, Output and Pkcs11ing Library
2  *
3  * Copyright © 2011 Collabora Ltd.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published
7  * by the Free Software Foundation; either version 2 of the licence or (at
8  * your option) any later version.
9  *
10  * See the included COPYING file for more information.
11  *
12  * Author: Stef Walter <stefw@collabora.co.uk>
13  */
14
15 #ifndef __G_PKCS11_PIN_H__
16 #define __G_PKCS11_PIN_H__
17
18 #include <gio/gio.h>
19 #include <p11-kit/pin.h>
20
21 G_BEGIN_DECLS
22
23 #define G_TYPE_PKCS11_PIN            (g_pkcs11_pin_get_type ())
24 #define G_PKCS11_PIN(inst)           (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_PKCS11_PIN, GPkcs11Pin))
25 #define G_PKCS11_PIN_CLASS(class)    (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_PKCS11_PIN, GPkcs11PinClass))
26 #define G_IS_PKCS11_PIN(inst)        (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_PKCS11_PIN))
27 #define G_IS_PKCS11_PIN_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_PKCS11_PIN))
28 #define G_PKCS11_PIN_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), G_TYPE_PKCS11_PIN, GPkcs11PinClass))
29
30 typedef struct _GPkcs11PinPrivate                   GPkcs11PinPrivate;
31 typedef struct _GPkcs11PinClass                     GPkcs11PinClass;
32 typedef struct _GPkcs11Pin                          GPkcs11Pin;
33
34 struct _GPkcs11PinClass
35 {
36   GTlsPasswordClass parent_class;
37 };
38
39 struct _GPkcs11Pin
40 {
41   GTlsPassword parent_instance;
42   GPkcs11PinPrivate *priv;
43 };
44
45 GType                   g_pkcs11_pin_get_type        (void) G_GNUC_CONST;
46
47 GTlsPassword *          g_pkcs11_pin_new             (GTlsPasswordFlags  flags,
48                                                       const gchar       *description);
49
50 P11KitPin *             g_pkcs11_pin_steal_internal  (GPkcs11Pin  *self);
51
52 G_END_DECLS
53
54 #endif /* __G_PKCS11_PIN_H___ */