1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Authors: Jeffrey Stedfast <fejj@ximian.com>
5 * Copyright 2001 Ximian, Inc. (www.ximian.com)
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of version 2 of the GNU Lesser General Public
9 * License as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
27 #include <camel/camel-object.h>
28 #include <camel/camel-exception.h>
29 #include <camel/camel-service.h>
31 #define CAMEL_SASL_TYPE (camel_sasl_get_type ())
32 #define CAMEL_SASL(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SASL_TYPE, CamelSasl))
33 #define CAMEL_SASL_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_TYPE, CamelSaslClass))
34 #define CAMEL_IS_SASL(o) (CAMEL_CHECK_TYPE((o), CAMEL_SASL_TYPE))
38 typedef struct _CamelSasl {
39 CamelObject parent_object;
42 char *mech; /* mechanism */
43 CamelService *service;
44 gboolean authenticated;
48 typedef struct _CamelSaslClass {
49 CamelObjectClass parent_class;
51 GByteArray * (*challenge) (CamelSasl *sasl, GByteArray *token, CamelException *ex);
56 /* Standard Camel function */
57 CamelType camel_sasl_get_type (void);
60 GByteArray *camel_sasl_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex);
61 char *camel_sasl_challenge_base64 (CamelSasl *sasl, const char *token, CamelException *ex);
63 gboolean camel_sasl_authenticated (CamelSasl *sasl);
65 /* utility functions */
66 CamelSasl *camel_sasl_new (const char *service_name, const char *mechanism, CamelService *service);
68 GList *camel_sasl_authtype_list (gboolean include_plain);
69 CamelServiceAuthType *camel_sasl_authtype (const char *mechanism);
73 #endif /* CAMEL_SASL_H */