[gcr] Implement GcrPkcs11Certificate which loads certs from PKCS#11
[platform/upstream/gcr.git] / gcr / gcr-pkcs11-certificate.h
1 /*
2  * gnome-keyring
3  *
4  * Copyright (C) 2010 Collabora Ltd
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as
8  * published by the Free Software Foundation; either version 2.1 of
9  * the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19  * 02111-1307, USA.
20  *
21  * Author: Stef Walter <stefw@collabora.co.uk>
22  */
23
24 #if !defined (__GCR_H_INSIDE__) && !defined (GCR_COMPILATION)
25 #error "Only <gcr/gcr.h> can be included directly."
26 #endif
27
28 #ifndef __GCR_PKCS11_CERTIFICATE_H__
29 #define __GCR_PKCS11_CERTIFICATE_H__
30
31 #include "gcr-types.h"
32 #include "gcr-certificate.h"
33
34 #include <glib-object.h>
35
36 G_BEGIN_DECLS
37
38 #define GCR_TYPE_PKCS11_CERTIFICATE               (gcr_pkcs11_certificate_get_type ())
39 #define GCR_PKCS11_CERTIFICATE(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCR_TYPE_CERTIFICATE, GcrPkcs11Certificate))
40 #define GCR_PKCS11_CERTIFICATE_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GCR_TYPE_CERTIFICATE, GcrPkcs11CertificateClass))
41 #define GCR_IS_PKCS11_CERTIFICATE(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCR_TYPE_CERTIFICATE))
42 #define GCR_IS_PKCS11_CERTIFICATE_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), GCR_TYPE_CERTIFICATE))
43 #define GCR_PKCS11_CERTIFICATE_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GCR_TYPE_CERTIFICATE, GcrPkcs11CertificateClass))
44
45 typedef struct _GcrPkcs11Certificate GcrPkcs11Certificate;
46 typedef struct _GcrPkcs11CertificateClass GcrPkcs11CertificateClass;
47 typedef struct _GcrPkcs11CertificatePrivate GcrPkcs11CertificatePrivate;
48
49 struct _GcrPkcs11Certificate {
50         GckObject parent;
51         GcrPkcs11CertificatePrivate *pv;
52 };
53
54 struct _GcrPkcs11CertificateClass {
55         GckObjectClass parent_class;
56 };
57
58 GType                   gcr_pkcs11_certificate_get_type               (void);
59
60 GckAttributes*          gcr_pkcs11_certificate_get_attributes         (GcrPkcs11Certificate *self);
61
62 GcrCertificate*         gcr_pkcs11_certificate_lookup_issuer          (GcrCertificate *cert,
63                                                                        GCancellable *cancel,
64                                                                        GError **error);
65
66 void                    gcr_pkcs11_certificate_lookup_issuer_async    (GcrCertificate *cert,
67                                                                        GCancellable *cancel,
68                                                                        GAsyncReadyCallback callback,
69                                                                        gpointer user_data);
70
71 GcrCertificate*         gcr_pkcs11_certificate_lookup_issuer_finish   (GAsyncResult *res,
72                                                                        GError **error);
73
74 G_END_DECLS
75
76 #endif /* __GCR_PKCS11_CERTIFICATE_H__ */