~ubuntu-branches/ubuntu/trusty/lasso/trusty

« back to all changes in this revision

Viewing changes to lasso/xml/dsig/ds_rsa_key_value.c

  • Committer: Package Import Robot
  • Author(s): Frederic Peters
  • Date: 2014-01-07 13:22:21 UTC
  • mfrom: (1.1.11) (7.1.14 sid)
  • Revision ID: package-import@ubuntu.com-20140107132221-htp0go0s9z5lqvj8
Tags: 2.4.0-1
* New upstream version.
* debian/control, debian/rules: use autoreconf
* debian/source/version: switch to 3.0 (quilt)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id$
 
2
 *
 
3
 * Lasso - A free implementation of the Liberty Alliance specifications.
 
4
 *
 
5
 * Copyright (C) 2004-2007 Entr'ouvert
 
6
 * http://lasso.entrouvert.org
 
7
 *
 
8
 * Authors: See AUTHORS file in top-level directory.
 
9
 *
 
10
 * This program is free software; you can redistribute it and/or modify
 
11
 * it under the terms of the GNU General Public License as published by
 
12
 * the Free Software Foundation; either version 2 of the License, or
 
13
 * (at your option) any later version.
 
14
 *
 
15
 * This program is distributed in the hope that it will be useful,
 
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
 * GNU General Public License for more details.
 
19
 *
 
20
 * You should have received a copy of the GNU General Public License
 
21
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
 
22
 */
 
23
 
 
24
#include "../private.h"
 
25
#include "ds_rsa_key_value.h"
 
26
 
 
27
/*
 
28
 * SECTION:ds_rsa_key_value
 
29
 * @short_description: Object representation of an XML DSIG element to hold an RSA key
 
30
 *
 
31
 */
 
32
 
 
33
/*****************************************************************************/
 
34
/* private methods                                                           */
 
35
/*****************************************************************************/
 
36
 
 
37
static struct XmlSnippet schema_snippets[] = {
 
38
        { "Modulus", SNIPPET_CONTENT, G_STRUCT_OFFSET(LassoDsRsaKeyValue, Modulus), NULL, NULL, NULL},
 
39
        { "Exponent", SNIPPET_CONTENT, G_STRUCT_OFFSET(LassoDsRsaKeyValue, Exponent), NULL, NULL, NULL},
 
40
        {NULL, 0, 0, NULL, NULL, NULL}
 
41
};
 
42
 
 
43
/*****************************************************************************/
 
44
/* instance and class init functions                                         */
 
45
/*****************************************************************************/
 
46
 
 
47
 
 
48
static void
 
49
class_init(LassoDsRsaKeyValueClass *klass)
 
50
{
 
51
        LassoNodeClass *nclass = LASSO_NODE_CLASS(klass);
 
52
 
 
53
        nclass->node_data = g_new0(LassoNodeClassData, 1);
 
54
        lasso_node_class_set_nodename(nclass, "RsaKeyValue");
 
55
        lasso_node_class_set_ns(nclass, LASSO_DS_HREF, LASSO_DS_PREFIX);
 
56
        lasso_node_class_add_snippets(nclass, schema_snippets);
 
57
}
 
58
 
 
59
GType
 
60
lasso_ds_rsa_key_value_get_type()
 
61
{
 
62
        static GType this_type = 0;
 
63
 
 
64
        if (!this_type) {
 
65
                static const GTypeInfo this_info = {
 
66
                        sizeof (LassoDsRsaKeyValueClass),
 
67
                        NULL,
 
68
                        NULL,
 
69
                        (GClassInitFunc) class_init,
 
70
                        NULL,
 
71
                        NULL,
 
72
                        sizeof(LassoDsRsaKeyValue),
 
73
                        0,
 
74
                        NULL,
 
75
                        NULL
 
76
                };
 
77
 
 
78
                this_type = g_type_register_static(LASSO_TYPE_NODE,
 
79
                                "LassoDsRsaKeyValue", &this_info, 0);
 
80
        }
 
81
        return this_type;
 
82
}
 
83
 
 
84
/**
 
85
 * lasso_ds_rsa_key_value_new:
 
86
 *
 
87
 * Creates a new #LassoDsRsaKeyValue object.
 
88
 *
 
89
 * Return value: a newly created #LassoDsRsaKeyValue object
 
90
 **/
 
91
LassoDsRsaKeyValue*
 
92
lasso_ds_rsa_key_value_new()
 
93
{
 
94
        return g_object_new(LASSO_TYPE_DS_RSA_KEY_VALUE, NULL);
 
95
}