diff options
author | Valery Febvre <vfebvre at easter-eggs.com> | 2004-08-19 12:45:05 +0000 |
---|---|---|
committer | Valery Febvre <vfebvre at easter-eggs.com> | 2004-08-19 12:45:05 +0000 |
commit | 73113ee6bd8ea80a335d67efb4f7a99cde17fdd2 (patch) | |
tree | 7b858815aadfe07784d63a009eea4dee2705d3dc /lasso | |
parent | 91dda0f98173fe7d3251ba2e22a96e39b553275e (diff) | |
download | lasso-73113ee6bd8ea80a335d67efb4f7a99cde17fdd2.tar.gz lasso-73113ee6bd8ea80a335d67efb4f7a99cde17fdd2.tar.xz lasso-73113ee6bd8ea80a335d67efb4f7a99cde17fdd2.zip |
Added 2 methods:
lasso_samlp_response_abstract_set_signature_tmpl(),
lasso_samlp_response_abstract_sign_signature_tmpl()
Removed err param in lasso_samlp_response_abstract_set_signature()
Diffstat (limited to 'lasso')
-rw-r--r-- | lasso/xml/samlp_response_abstract.c | 63 | ||||
-rw-r--r-- | lasso/xml/samlp_response_abstract.h | 45 |
2 files changed, 65 insertions, 43 deletions
diff --git a/lasso/xml/samlp_response_abstract.c b/lasso/xml/samlp_response_abstract.c index 04c3cbba..87b3f103 100644 --- a/lasso/xml/samlp_response_abstract.c +++ b/lasso/xml/samlp_response_abstract.c @@ -134,43 +134,58 @@ lasso_samlp_response_abstract_set_responseID(LassoSamlpResponseAbstract *node, class->set_prop(LASSO_NODE (node), "ResponseID", responseID); } +/* obsolete method */ gint -lasso_samlp_response_abstract_set_signature(LassoSamlpResponseAbstract *node, - gint sign_method, - const xmlChar *private_key_file, - const xmlChar *certificate_file, - GError **err) +lasso_samlp_response_abstract_set_signature(LassoSamlpResponseAbstract *node, + gint sign_method, + const xmlChar *private_key_file, + const xmlChar *certificate_file) { gint ret; - GError *tmp_err = NULL; LassoNodeClass *class; - if (err != NULL && *err != NULL) { - g_set_error(err, g_quark_from_string("Lasso"), - LASSO_PARAM_ERROR_ERR_CHECK_FAILED, - lasso_strerror(LASSO_PARAM_ERROR_ERR_CHECK_FAILED)); - g_return_val_if_fail (err == NULL || *err == NULL, - LASSO_PARAM_ERROR_ERR_CHECK_FAILED); - } - if (LASSO_IS_SAMLP_RESPONSE_ABSTRACT(node) == FALSE) { - g_set_error(err, g_quark_from_string("Lasso"), - LASSO_PARAM_ERROR_BADTYPE_OR_NULL_OBJ, - lasso_strerror(LASSO_PARAM_ERROR_BADTYPE_OR_NULL_OBJ)); - g_return_val_if_fail(LASSO_IS_SAMLP_RESPONSE_ABSTRACT(node), - LASSO_PARAM_ERROR_BADTYPE_OR_NULL_OBJ); - } + g_return_val_if_fail(LASSO_IS_SAMLP_RESPONSE_ABSTRACT(node), + LASSO_PARAM_ERROR_BADTYPE_OR_NULL_OBJ); class = LASSO_NODE_GET_CLASS(node); ret = class->add_signature(LASSO_NODE (node), sign_method, - private_key_file, certificate_file, &tmp_err); - if (ret < 0) { - g_propagate_error (err, tmp_err); - } + private_key_file, certificate_file); return (ret); } +gint +lasso_samlp_response_abstract_set_signature_tmpl(LassoSamlpResponseAbstract *node, + lassoSignatureType sign_type, + lassoSignatureMethod sign_method) +{ + LassoNodeClass *class; + + g_return_val_if_fail(LASSO_IS_SAMLP_RESPONSE_ABSTRACT(node), + LASSO_PARAM_ERROR_BADTYPE_OR_NULL_OBJ); + + class = LASSO_NODE_GET_CLASS(node); + + return(class->add_signature_tmpl(LASSO_NODE (node), sign_type, sign_method)); +} + +gint +lasso_samlp_response_abstract_sign_signature_tmpl(LassoSamlpResponseAbstract *node, + const xmlChar *private_key_file, + const xmlChar *certificate_file) +{ + LassoNodeClass *class; + + g_return_val_if_fail(LASSO_IS_SAMLP_RESPONSE_ABSTRACT(node), + LASSO_PARAM_ERROR_BADTYPE_OR_NULL_OBJ); + + class = LASSO_NODE_GET_CLASS(node); + + return(class->sign_signature_tmpl(LASSO_NODE (node), private_key_file, + certificate_file)); +} + /*****************************************************************************/ /* instance and class init functions */ /*****************************************************************************/ diff --git a/lasso/xml/samlp_response_abstract.h b/lasso/xml/samlp_response_abstract.h index 7a871e9c..c18d47f4 100644 --- a/lasso/xml/samlp_response_abstract.h +++ b/lasso/xml/samlp_response_abstract.h @@ -52,33 +52,40 @@ struct _LassoSamlpResponseAbstractClass { /*< vtable >*/ }; -LASSO_EXPORT GType lasso_samlp_response_abstract_get_type (void); +LASSO_EXPORT GType lasso_samlp_response_abstract_get_type (void); -LASSO_EXPORT LassoNode* lasso_samlp_response_abstract_new (void); +LASSO_EXPORT LassoNode* lasso_samlp_response_abstract_new (void); -LASSO_EXPORT void lasso_samlp_response_abstract_set_inResponseTo (LassoSamlpResponseAbstract *node, - const xmlChar *inResponseTo); +LASSO_EXPORT void lasso_samlp_response_abstract_set_inResponseTo (LassoSamlpResponseAbstract *node, + const xmlChar *inResponseTo); -LASSO_EXPORT void lasso_samlp_response_abstract_set_issueInstant (LassoSamlpResponseAbstract *node, - const xmlChar *issueInstant); +LASSO_EXPORT void lasso_samlp_response_abstract_set_issueInstant (LassoSamlpResponseAbstract *node, + const xmlChar *issueInstant); -LASSO_EXPORT void lasso_samlp_response_abstract_set_majorVersion (LassoSamlpResponseAbstract *node, - const xmlChar *majorVersion); +LASSO_EXPORT void lasso_samlp_response_abstract_set_majorVersion (LassoSamlpResponseAbstract *node, + const xmlChar *majorVersion); -LASSO_EXPORT void lasso_samlp_response_abstract_set_minorVersion (LassoSamlpResponseAbstract *node, - const xmlChar *minorVersion); +LASSO_EXPORT void lasso_samlp_response_abstract_set_minorVersion (LassoSamlpResponseAbstract *node, + const xmlChar *minorVersion); -LASSO_EXPORT void lasso_samlp_response_abstract_set_recipient (LassoSamlpResponseAbstract *node, - const xmlChar *recipient); +LASSO_EXPORT void lasso_samlp_response_abstract_set_recipient (LassoSamlpResponseAbstract *node, + const xmlChar *recipient); -LASSO_EXPORT void lasso_samlp_response_abstract_set_responseID (LassoSamlpResponseAbstract *node, - const xmlChar *responseID); +LASSO_EXPORT void lasso_samlp_response_abstract_set_responseID (LassoSamlpResponseAbstract *node, + const xmlChar *responseID); -LASSO_EXPORT gint lasso_samlp_response_abstract_set_signature (LassoSamlpResponseAbstract *node, - gint sign_method, - const xmlChar *private_key_file, - const xmlChar *certificate_file, - GError **err); +LASSO_EXPORT gint lasso_samlp_response_abstract_set_signature (LassoSamlpResponseAbstract *node, + gint sign_method, + const xmlChar *private_key_file, + const xmlChar *certificate_file); + +LASSO_EXPORT gint lasso_samlp_response_abstract_set_signature_tmpl (LassoSamlpResponseAbstract *node, + lassoSignatureType sign_type, + lassoSignatureMethod sign_method); + +LASSO_EXPORT gint lasso_samlp_response_abstract_sign_signature_tmpl (LassoSamlpResponseAbstract *node, + const xmlChar *private_key_file, + const xmlChar *certificate_file); #ifdef __cplusplus } |