2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU Lesser General Public
4 * License as published by the Free Software Foundation; either
5 * version 2 of the License, or (at your option) version 3.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Lesser General Public License for more details.
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with the program; if not, see <http://www.gnu.org/licenses/>
17 * Chris Toshok <toshok@ximian.com>
19 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
22 #ifndef E_ASN1_OBJECT_H
23 #define E_ASN1_OBJECT_H
25 #include <glib-object.h>
29 #define E_TYPE_ASN1_OBJECT (e_asn1_object_get_type ())
30 #define E_ASN1_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_ASN1_OBJECT, EASN1Object))
31 #define E_ASN1_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_ASN1_OBJECT, EASN1ObjectClass))
32 #define E_IS_ASN1_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_ASN1_OBJECT))
33 #define E_IS_ASN1_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_ASN1_OBJECT))
34 #define E_ASN1_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_ASN1_OBJECT, EASN1ObjectClass))
36 typedef struct _EASN1Object EASN1Object;
37 typedef struct _EASN1ObjectClass EASN1ObjectClass;
38 typedef struct _EASN1ObjectPrivate EASN1ObjectPrivate;
42 * Identifiers for the possible types of object.
44 E_ASN1_OBJECT_TYPE_END_CONTENTS = 0,
45 E_ASN1_OBJECT_TYPE_BOOLEAN = 1,
46 E_ASN1_OBJECT_TYPE_INTEGER = 2,
47 E_ASN1_OBJECT_TYPE_BIT_STRING = 3,
48 E_ASN1_OBJECT_TYPE_OCTET_STRING = 4,
49 E_ASN1_OBJECT_TYPE_NULL = 5,
50 E_ASN1_OBJECT_TYPE_OBJECT_ID = 6,
51 E_ASN1_OBJECT_TYPE_ENUMERATED = 10,
52 E_ASN1_OBJECT_TYPE_UTF8_STRING = 12,
53 E_ASN1_OBJECT_TYPE_SEQUENCE = 16,
54 E_ASN1_OBJECT_TYPE_SET = 17,
55 E_ASN1_OBJECT_TYPE_PRINTABLE_STRING = 19,
56 E_ASN1_OBJECT_TYPE_T61_STRING = 20,
57 E_ASN1_OBJECT_TYPE_IA5_STRING = 22,
58 E_ASN1_OBJECT_TYPE_UTC_TIME = 23,
59 E_ASN1_OBJECT_TYPE_GEN_TIME = 24,
60 E_ASN1_OBJECT_TYPE_VISIBLE_STRING = 26,
61 E_ASN1_OBJECT_TYPE_UNIVERSAL_STRING = 28,
62 E_ASN1_OBJECT_TYPE_BMP_STRING = 30,
63 E_ASN1_OBJECT_TYPE_HIGH_TAG_NUMBER = 31,
64 E_ASN1_OBJECT_TYPE_CONTEXT_SPECIFIC = 32,
65 E_ASN1_OBJECT_TYPE_APPLICATION = 33,
66 E_ASN1_OBJECT_TYPE_PRIVATE = 34
72 EASN1ObjectPrivate *priv;
75 struct _EASN1ObjectClass {
76 GObjectClass parent_class;
78 /* Padding for future expansion */
79 void (*_ecert_reserved0) (void);
80 void (*_ecert_reserved1) (void);
81 void (*_ecert_reserved2) (void);
82 void (*_ecert_reserved3) (void);
83 void (*_ecert_reserved4) (void);
86 GType e_asn1_object_get_type (void);
87 EASN1Object * e_asn1_object_new (void);
88 EASN1Object * e_asn1_object_new_from_cert (CERTCertificate *cert);
90 void e_asn1_object_set_valid_container (EASN1Object *obj,
92 gboolean e_asn1_object_is_valid_container (EASN1Object *obj);
93 PRUint32 e_asn1_object_get_asn1_type (EASN1Object *obj);
94 PRUint32 e_asn1_object_get_asn1_tag (EASN1Object *obj);
95 GList * e_asn1_object_get_children (EASN1Object *obj);
96 void e_asn1_object_append_child (EASN1Object *parent,
98 void e_asn1_object_set_display_name (EASN1Object *obj,
100 const gchar * e_asn1_object_get_display_name (EASN1Object *obj);
101 void e_asn1_object_set_display_value (EASN1Object *obj,
103 const gchar * e_asn1_object_get_display_value (EASN1Object *obj);
105 void e_asn1_object_get_data (EASN1Object *obj,
109 #endif /* E_ASN1_OBJECT_H */