diff options
author | Nicolas Clapies <nclapies@entrouvert.com> | 2004-07-06 19:11:01 +0000 |
---|---|---|
committer | Nicolas Clapies <nclapies@entrouvert.com> | 2004-07-06 19:11:01 +0000 |
commit | c122a7727a1b873eee2293496d9b4db238ce2fd4 (patch) | |
tree | a7242a857e4d5e56f2d36217b40cd660907ae8d5 /lasso/id-ff/server.c | |
parent | b455c8fd195c27ff488cbde7abece94a580d1807 (diff) | |
download | lasso-c122a7727a1b873eee2293496d9b4db238ce2fd4.tar.gz lasso-c122a7727a1b873eee2293496d9b4db238ce2fd4.tar.xz lasso-c122a7727a1b873eee2293496d9b4db238ce2fd4.zip |
*** empty log message ***
Diffstat (limited to 'lasso/id-ff/server.c')
-rw-r--r-- | lasso/id-ff/server.c | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/lasso/id-ff/server.c b/lasso/id-ff/server.c index 34e3c093..3314a551 100644 --- a/lasso/id-ff/server.c +++ b/lasso/id-ff/server.c @@ -28,6 +28,49 @@ /* public methods */ /*****************************************************************************/ +xmlChar * +lasso_server_dump(LassoServer *server) +{ + LassoProvider *provider; + LassoNode *server_node, *providers_node; + LassoNodeClass *server_class, *providers_class; + xmlChar *signature_method_str, *dump; + gint i; + + server_node = lasso_node_new(); + server_class = LASSO_NODE_GET_CLASS(server_node); + server_class->set_name(server_node, "Server"); + + /* set private key and signature method */ + if(server->private_key) + server_class->set_prop(server_node, "PrivateKey", server->private_key); + + /* TODO : add the signature method in the dump */ + + /* set public key, certificate, metadata */ + provider = LASSO_PROVIDER(server); + server_class->add_child(server_node, provider->metadata, FALSE); + if(provider->public_key) + server_class->set_prop(server_node, "PublicKey", provider->public_key); + if(provider->certificate) + server_class->set_prop(server_node, "Certificate", provider->certificate); + + /* set Providers node */ + providers_node = lasso_node_new(); + providers_class = LASSO_NODE_GET_CLASS(providers_node); + providers_class->set_name(providers_node, "Providers"); + + /* add providers */ + for(i = 0; i<server->providers->len; i++){ + dump = lasso_provider_dump(g_ptr_array_index(server->providers, i)); + providers_class->add_child(providers_node, lasso_node_new_from_dump(dump), TRUE); + } + + server_class->add_child(server_node, providers_node, FALSE); + + return(lasso_node_export(server_node)); +} + gint lasso_server_add_provider(LassoServer *server, gchar *metadata, @@ -71,7 +114,6 @@ static void lasso_server_instance_init(LassoServer *server) { server->providers = g_ptr_array_new(); - server->private_key = NULL; } @@ -129,3 +171,13 @@ lasso_server_new(const gchar *metadata, return(server); } + +LassoServer * +lasso_server_new_from_dump(xmlChar *dump) +{ + LassoServer *server; + + server = LASSO_SERVER(g_object_new(LASSO_TYPE_SERVER, NULL)); + + return(server); +} |