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 #ifndef __LASSO_PROVIDER_PRIVATE_H__ 25 #define __LASSO_PROVIDER_PRIVATE_H__ 26 27 #include <./serverprivate.h> 28 #include "../xml/private.h" 29 30 #ifdef __cplusplus 31 extern "C" { 32 #endif /* __cplusplus */ 33 34 35 /** 36 * LassoPublicKeyType: 37 * @LASSO_PUBLIC_KEY_SIGNING: Signing public key 38 * @LASSO_PUBLIC_KEY_ENCRYPTION: Encryption public key 39 * 40 * Public key type. 41 */ 42 typedef enum { 43 LASSO_PUBLIC_KEY_SIGNING, 44 LASSO_PUBLIC_KEY_ENCRYPTION 45 } LassoPublicKeyType; 46 47 /* This structure should allow to map ID-FFv1.2 and SAMLv2 endpoints */ 48 struct EndpointType_s { 49 LassoProviderRole role; 50 char *kind; 51 char *binding; 52 char *url; 53 char *return_url; 54 int index; 55 int is_default; 56 }; 57 typedef struct EndpointType_s EndpointType; 58 59 60 struct _LassoProviderPrivate 61 { 62 gboolean dispose_has_run; 63 64 LassoProviderRole roles; 65 LassoProtocolConformance conformance; 66 GHashTable *Descriptors; 67 GList *attributes; /* of LassoSaml2Attribute */ 68 char *default_assertion_consumer; 69 xmlNode *organization; 70 71 char *affiliation_owner_id; 72 char *affiliation_id; 73 74 GList *signing_public_keys; 75 GList *signing_key_descriptors; 76 xmlNode *encryption_key_descriptor; 77 char *encryption_public_key_str; 78 GList *encryption_public_keys; 79 LassoEncryptionMode encryption_mode; 80 LassoEncryptionSymKeyType encryption_sym_key_type; 81 char *valid_until; 82 char *cache_duration; 83 GList *endpoints; /* of EndpointType_s */ 84 LassoSignatureContext signature_context; 85 }; 86 87 gboolean lasso_provider_load_metadata(LassoProvider *provider, const gchar *metadata); 88 gboolean lasso_provider_load_metadata_from_buffer(LassoProvider *provider, const gchar *metadata); 89 gboolean lasso_provider_load_public_key(LassoProvider *provider, 90 LassoPublicKeyType public_key_type); 91 GList* lasso_provider_get_public_keys(const LassoProvider *provider); 92 xmlSecKey* lasso_provider_get_encryption_public_key(const LassoProvider *provider); 93 LassoEncryptionSymKeyType lasso_provider_get_encryption_sym_key_type(const LassoProvider* provider); 94 int lasso_provider_verify_saml_signature(LassoProvider *provider, xmlNode *signed_node, xmlDoc *doc); 95 int lasso_provider_verify_query_signature(LassoProvider *provider, const char *message); 96 void _lasso_provider_load_key_descriptor(LassoProvider *provider, xmlNode *key_descriptor); 97 void _lasso_provider_add_metadata_value_for_role(LassoProvider *provider, 98 LassoProviderRole role, const char *name, const char *value); 99 LassoProvider* lasso_provider_new_from_xmlnode(LassoProviderRole role, xmlNode *node); 100 101 #ifdef __cplusplus 102 } 103 #endif /* __cplusplus */ 104 105 #endif /* __LASSO_PROVIDER_PRIVATE_H__ */ 106