Branch data Line data Source code
1 : : /* 2 : : * Copyright (C) 2011 Collabora Ltd. 3 : : * 4 : : * This program is free software; you can redistribute it and/or modify 5 : : * it under the terms of the GNU Lesser General Public License as 6 : : * published by the Free Software Foundation; either version 2.1 of 7 : : * the License, or (at your option) any later version. 8 : : * 9 : : * This program is distributed in the hope that it will be useful, but 10 : : * WITHOUT ANY WARRANTY; without even the implied warranty of 11 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 : : * Lesser General Public License for more details. 13 : : * 14 : : * You should have received a copy of the GNU Lesser General Public 15 : : * License along with this program; if not, see <http://www.gnu.org/licenses/>. 16 : : * 17 : : * Author: Stef Walter <stefw@collabora.co.uk> 18 : : */ 19 : : 20 : : #ifndef __GCR_CERTIFICATE_REQUEST_H__ 21 : : #define __GCR_CERTIFICATE_REQUEST_H__ 22 : : 23 : : #if !defined (__GCR_INSIDE_HEADER__) && !defined (GCR_COMPILATION) 24 : : #error "Only <gcr/gcr.h> can be included directly." 25 : : #endif 26 : : 27 : : #include <glib-object.h> 28 : : 29 : : #include "gcr-types.h" 30 : : 31 : : G_BEGIN_DECLS 32 : : 33 : : typedef enum { 34 : : GCR_CERTIFICATE_REQUEST_PKCS10 = 1, 35 : : } GcrCertificateRequestFormat; 36 : : 37 : : #define GCR_TYPE_CERTIFICATE_REQUEST (gcr_certificate_request_get_type ()) 38 [ # # # # : 0 : G_DECLARE_FINAL_TYPE (GcrCertificateRequest, gcr_certificate_request, # # ] 39 : : GCR, CERTIFICATE_REQUEST, 40 : : GObject) 41 : : 42 : : gboolean gcr_certificate_request_capable (GckObject *private_key, 43 : : GCancellable *cancellable, 44 : : GError **error); 45 : : 46 : : void gcr_certificate_request_capable_async (GckObject *private_key, 47 : : GCancellable *cancellable, 48 : : GAsyncReadyCallback callback, 49 : : gpointer user_data); 50 : : 51 : : 52 : : gboolean gcr_certificate_request_capable_finish (GAsyncResult *result, 53 : : GError **error); 54 : : 55 : : GcrCertificateRequest * gcr_certificate_request_prepare (GcrCertificateRequestFormat format, 56 : : GckObject *private_key); 57 : : 58 : : GckObject * gcr_certificate_request_get_private_key (GcrCertificateRequest *self); 59 : : 60 : : GcrCertificateRequestFormat gcr_certificate_request_get_format (GcrCertificateRequest *self); 61 : : 62 : : void gcr_certificate_request_set_cn (GcrCertificateRequest *self, 63 : : const gchar *cn); 64 : : 65 : : gboolean gcr_certificate_request_complete (GcrCertificateRequest *self, 66 : : GCancellable *cancellable, 67 : : GError **error); 68 : : 69 : : void gcr_certificate_request_complete_async (GcrCertificateRequest *self, 70 : : GCancellable *cancellable, 71 : : GAsyncReadyCallback callback, 72 : : gpointer user_data); 73 : : 74 : : gboolean gcr_certificate_request_complete_finish (GcrCertificateRequest *self, 75 : : GAsyncResult *result, 76 : : GError **error); 77 : : 78 : : guchar * gcr_certificate_request_encode (GcrCertificateRequest *self, 79 : : gboolean textual, 80 : : gsize *length); 81 : : 82 : : G_END_DECLS 83 : : 84 : : #endif /* __GCR_CERTIFICATE_REQUEST_H__ */