diff options
| author | Romain Chantereay <rchantereau@entrouvert.com> | 2004-08-10 11:18:17 +0000 |
|---|---|---|
| committer | Romain Chantereay <rchantereau@entrouvert.com> | 2004-08-10 11:18:17 +0000 |
| commit | 94033fe5d9fc9d63d08d2fa9d0b12867459caf95 (patch) | |
| tree | 8b8995e0d570f0b734d1118ec8b67484de24dcd0 /java/src/c | |
| parent | c753e696c458cbb8e4e52d5413853fc0a72047c2 (diff) | |
| download | lasso-94033fe5d9fc9d63d08d2fa9d0b12867459caf95.tar.gz lasso-94033fe5d9fc9d63d08d2fa9d0b12867459caf95.tar.xz lasso-94033fe5d9fc9d63d08d2fa9d0b12867459caf95.zip | |
- Added java binding swig generation.
- Added Swig Interface file.
- Added readme for java build dependencies
- Removed old java/src directory (still present on the CVS and this is
important).
Diffstat (limited to 'java/src/c')
| -rw-r--r-- | java/src/c/.cvsignore | 2 | ||||
| -rw-r--r-- | java/src/c/Makefile.am | 33 | ||||
| -rw-r--r-- | java/src/c/com_entrouvert_lasso_Lasso.c | 48 | ||||
| -rw-r--r-- | java/src/c/com_entrouvert_lasso_LassoAuthnRequest.c | 154 | ||||
| -rw-r--r-- | java/src/c/com_entrouvert_lasso_LassoAuthnResponse.c | 94 | ||||
| -rw-r--r-- | java/src/c/com_entrouvert_lasso_LassoIdentity.c | 61 | ||||
| -rw-r--r-- | java/src/c/com_entrouvert_lasso_LassoLogin.c | 298 | ||||
| -rw-r--r-- | java/src/c/com_entrouvert_lasso_LassoLogout.c | 131 | ||||
| -rw-r--r-- | java/src/c/com_entrouvert_lasso_LassoNode.c | 36 | ||||
| -rw-r--r-- | java/src/c/com_entrouvert_lasso_LassoObject.c | 27 | ||||
| -rw-r--r-- | java/src/c/com_entrouvert_lasso_LassoProfile.c | 245 | ||||
| -rw-r--r-- | java/src/c/com_entrouvert_lasso_LassoProvider.c | 66 | ||||
| -rw-r--r-- | java/src/c/com_entrouvert_lasso_LassoRequest.c | 42 | ||||
| -rw-r--r-- | java/src/c/com_entrouvert_lasso_LassoResponse.c | 36 | ||||
| -rw-r--r-- | java/src/c/com_entrouvert_lasso_LassoServer.c | 113 | ||||
| -rw-r--r-- | java/src/c/com_entrouvert_lasso_LassoSession.c | 79 | ||||
| -rw-r--r-- | java/src/c/helper.c | 125 | ||||
| -rw-r--r-- | java/src/c/helper.h | 83 |
18 files changed, 0 insertions, 1673 deletions
diff --git a/java/src/c/.cvsignore b/java/src/c/.cvsignore deleted file mode 100644 index 36283c56..00000000 --- a/java/src/c/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -com_entrouvert_lasso_*.h -target_classes.h diff --git a/java/src/c/Makefile.am b/java/src/c/Makefile.am deleted file mode 100644 index c00bfe64..00000000 --- a/java/src/c/Makefile.am +++ /dev/null @@ -1,33 +0,0 @@ -if MINGW -JAVA_CFLAGS = -mno-cygwin -mwindows -D_MSC_VER=1 \ - -D_WIN32 -DWIN32 -DLASSO_DEBUG \ - -I$(top_srcdir) \ - -I. -g \ - -I/usr/local/include \ - -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include \ - -I/usr/local/include/libxml2 \ - -DXMLSEC_CRYPTO="openssl" -DXMLSEC_LIBXML_260=1 \ - -D__XMLSEC_FUNCTION__=__FUNCTION__ -DXMLSEC_NO_XKMS=1 \ - -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_CRYPTO_OPENSSL=1 -else -JAVA_CFLAGS = \ - -g \ - -I. -I/opt/jdk/include -I/opt/jdk/include/linux \ - -I$(top_srcdir) \ - -I/usr/include/libxml2 \ - -I/usr/include/glib-2.0 \ - -I/usr/lib/glib-2.0/include \ - -DXMLSEC_LIBXML_260=1 -D__XMLSEC_FUNCTION__=__FUNCTION__ -DXMLSEC_NO_XKMS=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -I/usr/include/xmlsec1 -I/usr/include/libxml2 -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_CRYPTO=\"openssl\" -endif -C_SOURCE = ${wildcard *.c} -C_OBJECT = ${C_SOURCE:.c=.o} - -.PHONY: clean all - -all: ${C_OBJECT} - -%.o: %.c %.h - ${CC} $(JAVA_CFLAGS) -c $< - -clean: - rm -f ${C_OBJECT} *~ diff --git a/java/src/c/com_entrouvert_lasso_Lasso.c b/java/src/c/com_entrouvert_lasso_Lasso.c deleted file mode 100644 index 170d44b4..00000000 --- a/java/src/c/com_entrouvert_lasso_Lasso.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * JLasso -- Java bindings for Lasso library - * - * Copyright (C) 2004 Entr'ouvert - * http://lasso.entrouvert.org - * - * Authors: Benjamin Poussin <poussin@codelutin.com> - * Emmanuel Raviart <eraviart@entrouvert.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <helper.h> -#include <com_entrouvert_lasso_Lasso.h> -#include <lasso/lasso.h> - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_Lasso_init -(JNIEnv * env, jclass clazz){ - return lasso_init(); -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_Lasso_shutdown -(JNIEnv * env, jclass clazz){ - return lasso_shutdown(); -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_Lasso_getRequestTypeFromSoapMsg -(JNIEnv * env, jclass clazz, jstring _value){ - int result; - char *value; - - value = (char*)(*env)->GetStringUTFChars(env, _value, NULL); - result = lasso_profile_get_request_type_from_soap_msg(value); - (*env)->ReleaseStringUTFChars(env, _value, value); - return result; -} diff --git a/java/src/c/com_entrouvert_lasso_LassoAuthnRequest.c b/java/src/c/com_entrouvert_lasso_LassoAuthnRequest.c deleted file mode 100644 index 4a1016bd..00000000 --- a/java/src/c/com_entrouvert_lasso_LassoAuthnRequest.c +++ /dev/null @@ -1,154 +0,0 @@ -/* - * JLasso -- Java bindings for Lasso library - * - * Copyright (C) 2004 Entr'ouvert - * http://lasso.entrouvert.org - * - * Authors: Benjamin Poussin <poussin@codelutin.com> - * Emmanuel Raviart <eraviart@entrouvert.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <helper.h> -#include <com_entrouvert_lasso_LassoAuthnRequest.h> -#include <lasso/lasso.h> - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoAuthnRequest_init -(JNIEnv * env, jobject this, jstring _providerID){ - LassoNode * request; - char * providerID; - - providerID = (char*)(*env)->GetStringUTFChars(env, _providerID, NULL); - - request = lasso_authn_request_new(providerID); - - (*env)->ReleaseStringUTFChars(env, _providerID, providerID); - - setCObject(env, this, request); -} - -/* From LassoLibAuthnRequest */ - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoAuthnRequest_setAffiliationID -(JNIEnv * env, jobject this, jstring _value){ - LassoAuthnRequest * request; - char * value; - - value = (char*)(*env)->GetStringUTFChars(env, _value, NULL); - - request = getCObject(env, this); - lasso_lib_authn_request_set_affiliationID((LassoLibAuthnRequest*)request, value); - - (*env)->ReleaseStringUTFChars(env, _value, value); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoAuthnRequest_setassertionConsumerServiceID -(JNIEnv * env, jobject this, jstring _value){ - LassoAuthnRequest * request; - char * value; - - value = (char*)(*env)->GetStringUTFChars(env, _value, NULL); - - request = getCObject(env, this); - lasso_lib_authn_request_set_assertionConsumerServiceID((LassoLibAuthnRequest*)request, value); - - (*env)->ReleaseStringUTFChars(env, _value, value); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoAuthnRequest_setConsent -(JNIEnv * env, jobject this, jstring _value){ - LassoAuthnRequest * request; - char * value; - - value = (char*)(*env)->GetStringUTFChars(env, _value, NULL); - - request = getCObject(env, this); - lasso_lib_authn_request_set_consent((LassoLibAuthnRequest*)request, value); - - (*env)->ReleaseStringUTFChars(env, _value, value); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoAuthnRequest_setForceAuthn -(JNIEnv * env, jobject this, jboolean _value){ - LassoAuthnRequest * request; - - request = getCObject(env, this); - lasso_lib_authn_request_set_forceAuthn((LassoLibAuthnRequest*)request, _value); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoAuthnRequest_setPassive -(JNIEnv * env, jobject this, jboolean _value){ - LassoAuthnRequest * request; - char * value; - - request = getCObject(env, this); - lasso_lib_authn_request_set_isPassive((LassoLibAuthnRequest*)request, _value); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoAuthnRequest_setNameIdPolicy -(JNIEnv * env, jobject this, jstring _value){ - LassoAuthnRequest * request; - char * value; - - value = (char*)(*env)->GetStringUTFChars(env, _value, NULL); - - request = getCObject(env, this); - lasso_lib_authn_request_set_nameIDPolicy((LassoLibAuthnRequest*)request, value); - - (*env)->ReleaseStringUTFChars(env, _value, value); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoAuthnRequest_setProtocolProfile -(JNIEnv * env, jobject this, jstring _value){ - LassoAuthnRequest * request; - char * value; - - value = (char*)(*env)->GetStringUTFChars(env, _value, NULL); - - request = getCObject(env, this); - lasso_lib_authn_request_set_protocolProfile((LassoLibAuthnRequest*)request, value); - - (*env)->ReleaseStringUTFChars(env, _value, value); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoAuthnRequest_setproviderID -(JNIEnv * env, jobject this, jstring _value){ - LassoAuthnRequest * request; - char * value; - - value = (char*)(*env)->GetStringUTFChars(env, _value, NULL); - - request = getCObject(env, this); - lasso_lib_authn_request_set_providerID((LassoLibAuthnRequest*)request, value); - - (*env)->ReleaseStringUTFChars(env, _value, value); -} - - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoAuthnRequest_setRelayState -(JNIEnv * env, jobject this, jstring _value){ - LassoAuthnRequest * request; - char * value; - - value = (char*)(*env)->GetStringUTFChars(env, _value, NULL); - - request = getCObject(env, this); - lasso_lib_authn_request_set_relayState((LassoLibAuthnRequest*)request, value); - - (*env)->ReleaseStringUTFChars(env, _value, value); -} - - diff --git a/java/src/c/com_entrouvert_lasso_LassoAuthnResponse.c b/java/src/c/com_entrouvert_lasso_LassoAuthnResponse.c deleted file mode 100644 index e324fb2d..00000000 --- a/java/src/c/com_entrouvert_lasso_LassoAuthnResponse.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * JLasso -- Java bindings for Lasso library - * - * Copyright (C) 2004 Entr'ouvert - * http://lasso.entrouvert.org - * - * Authors: Benjamin Poussin <poussin@codelutin.com> - * Emmanuel Raviart <eraviart@entrouvert.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <helper.h> -#include <com_entrouvert_lasso_LassoAuthnResponse.h> -#include <lasso/lasso.h> - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoAuthnResponse_init -(JNIEnv * env, jobject this, jstring _providerID, jobject _request){ - LassoNode * response; - char * providerID; - LassoNode * request; - - providerID = (char*)(*env)->GetStringUTFChars(env, _providerID, NULL); - request = getCObject(env, _request); - - response = lasso_authn_response_new(providerID, request); - - (*env)->ReleaseStringUTFChars(env, _providerID, providerID); - - setCObject(env, this, response); -} - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoAuthnResponse_getStatus -(JNIEnv * env, jobject this){ - LassoAuthnResponse * response; - char* result; - - response = getCObject(env, this); - result = lasso_authn_response_get_status(response); - - return (*env)->NewStringUTF(env, result); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoAuthnResponse_setContent -(JNIEnv * env, jobject this, jstring _value){ - LassoLibAuthnResponse * response; - char * value; - - value = (char*)(*env)->GetStringUTFChars(env, _value, NULL); - - response = getCObject(env, this); - lasso_lib_authn_response_set_consent(response, value); - - (*env)->ReleaseStringUTFChars(env, _value, value); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoAuthnResponse_setProviderID -(JNIEnv * env, jobject this, jstring _value){ - LassoLibAuthnResponse * response; - char * value; - - value = (char*)(*env)->GetStringUTFChars(env, _value, NULL); - - response = getCObject(env, this); - lasso_lib_authn_response_set_providerID(response, value); - - (*env)->ReleaseStringUTFChars(env, _value, value); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoAuthnResponse_setRelayState -(JNIEnv * env, jobject this, jstring _value){ -LassoLibAuthnResponse * response; - char * value; - - value = (char*)(*env)->GetStringUTFChars(env, _value, NULL); - - response = getCObject(env, this); - lasso_lib_authn_response_set_relayState(response, value); - - (*env)->ReleaseStringUTFChars(env, _value, value); -} - diff --git a/java/src/c/com_entrouvert_lasso_LassoIdentity.c b/java/src/c/com_entrouvert_lasso_LassoIdentity.c deleted file mode 100644 index b689d083..00000000 --- a/java/src/c/com_entrouvert_lasso_LassoIdentity.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * JLasso -- Java bindings for Lasso library - * - * Copyright (C) 2004 Entr'ouvert - * http://lasso.entrouvert.org - * - * Authors: Benjamin Poussin <poussin@codelutin.com> - * Emmanuel Raviart <eraviart@entrouvert.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <helper.h> -#include <com_entrouvert_lasso_LassoIdentity.h> -#include <lasso/lasso.h> - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoIdentity_init -(JNIEnv * env, jobject this){ - LassoIdentity *identity; - - identity = lasso_identity_new(); - - setCObject(env, this, identity); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoIdentity_initFromDump -(JNIEnv * env, jobject this, jstring _dump){ - LassoIdentity *identity; - char *dump; - - dump = (char*)(*env)->GetStringUTFChars(env, _dump, NULL); - identity = lasso_identity_new_from_dump(dump); - - (*env)->ReleaseStringUTFChars(env, _dump, dump); - - setCObject(env, this, identity); -} - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoIdentity_dump -(JNIEnv * env, jobject this){ - LassoIdentity *identity; - char* result; - - identity = (LassoIdentity*)getCObject(env, this); - result = lasso_identity_dump(identity); - - return (*env)->NewStringUTF(env, result); -} - diff --git a/java/src/c/com_entrouvert_lasso_LassoLogin.c b/java/src/c/com_entrouvert_lasso_LassoLogin.c deleted file mode 100644 index dd9d3aeb..00000000 --- a/java/src/c/com_entrouvert_lasso_LassoLogin.c +++ /dev/null @@ -1,298 +0,0 @@ -/* - * JLasso -- Java bindings for Lasso library - * - * Copyright (C) 2004 Entr'ouvert - * http://lasso.entrouvert.org - * - * Authors: Benjamin Poussin <poussin@codelutin.com> - * Emmanuel Raviart <eraviart@entrouvert.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <helper.h> -#include <lasso/lasso.h> -#include <com_entrouvert_lasso_LassoLogin.h> - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoLogin_init -(JNIEnv * env, jobject this, jobject _server) { - LassoLogin *login; - LassoServer* server; - - server = (LassoServer*)getCObject(env, _server); - login = LASSO_LOGIN(lasso_login_new(server)); - setCObject(env, this, login); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoLogin_initFromDump -(JNIEnv * env, jobject this, jobject _server, jobject _identity, jstring _dump) { - LassoLogin *login; - LassoServer* server; - char *dump; - LassoIdentity* identity = NULL; - - server = (LassoServer*)getCObject(env, _server); - if(_identity != NULL){ - identity = (LassoIdentity*)getCObject(env, _identity); - } - - dump = (char*)(*env)->GetStringUTFChars(env, _dump, NULL); - login = LASSO_LOGIN(lasso_login_new_from_dump(server, identity, dump)); - (*env)->ReleaseStringUTFChars(env, _dump, dump); - - setCObject(env, this, login); -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogin_buildArtifactMsg -(JNIEnv * env, jobject this, jboolean _authenticationResult, jstring _authenticationMethod, - jstring _reauthenticateOnOrAfter, jint _method) { - int result; - LassoLogin* login; - char *authenticationMethod; - char *reauthenticateOnOrAfter; - - authenticationMethod = (char*)(*env)->GetStringUTFChars(env, _authenticationMethod, NULL); - reauthenticateOnOrAfter = (char*)(*env)->GetStringUTFChars(env, _reauthenticateOnOrAfter, NULL); - - login = getCObject(env, this); - result = lasso_login_build_artifact_msg(login, - _authenticationResult, - authenticationMethod, - reauthenticateOnOrAfter, - _method); - - (*env)->ReleaseStringUTFChars(env, _authenticationMethod, authenticationMethod); - (*env)->ReleaseStringUTFChars(env, _reauthenticateOnOrAfter, reauthenticateOnOrAfter); - - return result; -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogin_buildAuthnRequestMsg -(JNIEnv * env, jobject this){ - int result; - LassoLogin* login; - - login = getCObject(env, this); - result = lasso_login_build_authn_request_msg(login); - - return result; -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogin_buildAuthnResponseMsg -(JNIEnv * env, jobject this, jint _authenticationResult, - jstring _authenticationMethod, - jstring _reauthenticateOnOrAfter){ - int result; - LassoLogin* login; - char *authenticationMethod; - char *reauthenticateOnOrAfter; - - authenticationMethod = (char*)(*env)->GetStringUTFChars(env, _authenticationMethod, NULL); - reauthenticateOnOrAfter = (char*)(*env)->GetStringUTFChars(env, _reauthenticateOnOrAfter, NULL); - - login = getCObject(env, this); - result = lasso_login_build_authn_response_msg(login, - _authenticationResult, - authenticationMethod, - reauthenticateOnOrAfter); - - (*env)->ReleaseStringUTFChars(env, _authenticationMethod, authenticationMethod); - (*env)->ReleaseStringUTFChars(env, _reauthenticateOnOrAfter, reauthenticateOnOrAfter); - - return result; -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogin_buildRequestMsg -(JNIEnv * env, jobject this){ - int result; - LassoLogin* login; - - login = getCObject(env, this); - result = lasso_login_build_request_msg(login); - - return result; -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogin_acceptSso -(JNIEnv * env, jobject this){ - LassoLogin* login; - int result; - - login = getCObject(env, this); - result = lasso_login_accept_sso(login); - - return result; -} - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoLogin_dump -(JNIEnv * env, jobject this){ - char* result; - LassoLogin* login; - - login = getCObject(env, this); - result = lasso_login_dump(login); - - return (*env)->NewStringUTF(env, result); -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogin_initAuthnRequest -(JNIEnv * env, jobject this, jstring _providerID){ - int result; - LassoLogin* login; - char *providerID; - - providerID = (char*)(*env)->GetStringUTFChars(env, _providerID, NULL); - - login = getCObject(env, this); - result = lasso_login_init_authn_request(login, providerID); - - (*env)->ReleaseStringUTFChars(env, _providerID, providerID); - - return result; -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogin_initFromAuthnRequestMsg -(JNIEnv * env, jobject this, jstring _authnRequestMsg, jint _authnRequestMethod) { - int result; - LassoLogin* login; - char *authnRequestMsg; - - authnRequestMsg = (char*)(*env)->GetStringUTFChars(env, _authnRequestMsg, NULL); - - login = getCObject(env, this); - result = lasso_login_init_from_authn_request_msg(login, - authnRequestMsg, - _authnRequestMethod); - - (*env)->ReleaseStringUTFChars(env, _authnRequestMsg, authnRequestMsg); - - return result; -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogin_initRequest -(JNIEnv * env, jobject this, jstring _responseMsg, jint _responseMethod) { - int result; - LassoLogin* login; - char *responseMsg; - - responseMsg = (char*)(*env)->GetStringUTFChars(env, _responseMsg, NULL); - - login = getCObject(env, this); - result = lasso_login_init_request(login, - responseMsg, - _responseMethod); - - (*env)->ReleaseStringUTFChars(env, _responseMsg, responseMsg); - - return result; -} - -JNIEXPORT jboolean JNICALL Java_com_entrouvert_lasso_LassoLogin_mustAuthenticate -(JNIEnv * env, jobject this) { - int result; - LassoLogin* login; - - login = getCObject(env, this); - result = lasso_login_must_authenticate(login); - - return result; -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogin_processAuthnResponseMsg -(JNIEnv * env, jobject this, jstring _authnResponseMsg) { - int result; - LassoLogin* login; - char *authnResponseMsg; - - authnResponseMsg = (char*)(*env)->GetStringUTFChars(env, _authnResponseMsg, NULL); - - login = getCObject(env, this); - result = lasso_login_process_authn_response_msg(login, - authnResponseMsg); - - (*env)->ReleaseStringUTFChars(env, _authnResponseMsg, authnResponseMsg); - - return result; -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogin_processRequestMsg -(JNIEnv * env, jobject this, jstring _requestMsg) { - int result; - LassoLogin* login; - char *requestMsg; - - requestMsg = (char*)(*env)->GetStringUTFChars(env, _requestMsg, NULL); - - login = getCObject(env, this); - result = lasso_login_process_request_msg(login, - requestMsg); - - (*env)->ReleaseStringUTFChars(env, _requestMsg, requestMsg); - - return result; -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogin_processResponseMsg -(JNIEnv * env, jobject this, jstring _responseMsg) { - int result; - LassoLogin* login; - char *responseMsg; - - responseMsg = (char*)(*env)->GetStringUTFChars(env, _responseMsg, NULL); - - login = getCObject(env, this); - result = lasso_login_process_response_msg(login, - responseMsg); - - (*env)->ReleaseStringUTFChars(env, _responseMsg, responseMsg); - - return result; -} - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoLogin_getAssertionArtifact -(JNIEnv * env, jobject this) { - LassoLogin * login; - char *result; - - login = getCObject(env, this); - - result = login->assertionArtifact; - - return (*env)->NewStringUTF(env, result); -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogin_getProtocolProfile -(JNIEnv * env, jobject this) { - LassoLogin * login; - int result; - - login = getCObject(env, this); - - result = login->protocolProfile; - - return result; -} - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoLogin_getResponseDump -(JNIEnv * env, jobject this) { - LassoLogin * login; - char *result; - - login = getCObject(env, this); - - result = login->response_dump; - - return (*env)->NewStringUTF(env, result); -} diff --git a/java/src/c/com_entrouvert_lasso_LassoLogout.c b/java/src/c/com_entrouvert_lasso_LassoLogout.c deleted file mode 100644 index fef9c212..00000000 --- a/java/src/c/com_entrouvert_lasso_LassoLogout.c +++ /dev/null @@ -1,131 +0,0 @@ -/* - * JLasso -- Java bindings for Lasso library - * - * Copyright (C) 2004 Entr'ouvert - * http://lasso.entrouvert.org - * - * Authors: Benjamin Poussin <poussin@codelutin.com> - * Emmanuel Raviart <eraviart@entrouvert.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <stdio.h> -#include <helper.h> -#include <com_entrouvert_lasso_LassoLogout.h> -#include <lasso/lasso.h> - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoLogout_init -(JNIEnv * env, jobject this, jobject _server, jint _providerType){ - LassoLogout *logout; - LassoServer* server; - - server = (LassoServer*)getCObject(env, _server); - logout = lasso_logout_new(server, _providerType); - - setCObject(env, this, logout); -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogout_buildRequestMsg -(JNIEnv * env, jobject this){ - int result; - LassoLogout* logout; - - logout = getCObject(env, this); - result = lasso_logout_build_request_msg(logout); - - return result; -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogout_buildResponseMsg -(JNIEnv * env, jobject this){ - int result; - LassoLogout* logout; - - logout = getCObject(env, this); - result = lasso_logout_build_response_msg(logout); - - return result; -} - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoLogout_getNextProviderId -(JNIEnv * env, jobject this){ - char* result; - LassoLogout* logout; - - logout = getCObject(env, this); - result = lasso_logout_get_next_providerID(logout); - if (! result) - return NULL; - return (*env)->NewStringUTF(env, result); -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogout_initRequest -(JNIEnv * env, jobject this, jstring _providerID){ - int result; - LassoLogout* logout; - char *providerID = NULL; - - if (_providerID) - providerID = (char*)(*env)->GetStringUTFChars(env, _providerID, NULL); - - logout = getCObject(env, this); - result = lasso_logout_init_request(logout, providerID); - - if (_providerID) - (*env)->ReleaseStringUTFChars(env, _providerID, providerID); - - return result; -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogout_loadRequestMsg -(JNIEnv * env, jobject this, jstring _requestMsg, jint _requestMethod){ - int result; - LassoLogout* logout; - char *requestMsg; - - requestMsg = (char*)(*env)->GetStringUTFChars(env, _requestMsg, NULL); - - logout = getCObject(env, this); - result = lasso_logout_load_request_msg(logout, requestMsg, _requestMethod); - - (*env)->ReleaseStringUTFChars(env, _requestMsg, requestMsg); - - return result; -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogout_processRequest -(JNIEnv * env, jobject this){ - LassoLogout* logout; - - logout = getCObject(env, this); - return lasso_logout_process_request(logout); -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogout_processResponseMsg -(JNIEnv * env, jobject this, jstring _responseMsg, jint _responseMethod){ - int result; - LassoLogout* logout; - char *responseMsg; - - responseMsg = (char*)(*env)->GetStringUTFChars(env, _responseMsg, NULL); - - logout = getCObject(env, this); - result = lasso_logout_process_response_msg(logout, responseMsg, _responseMethod); - - (*env)->ReleaseStringUTFChars(env, _responseMsg, responseMsg); - - return result; -} diff --git a/java/src/c/com_entrouvert_lasso_LassoNode.c b/java/src/c/com_entrouvert_lasso_LassoNode.c deleted file mode 100644 index 7a53415a..00000000 --- a/java/src/c/com_entrouvert_lasso_LassoNode.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * JLasso -- Java bindings for Lasso library - * - * Copyright (C) 2004 Entr'ouvert - * http://lasso.entrouvert.org - * - * Authors: Benjamin Poussin <poussin@codelutin.com> - * Emmanuel Raviart <eraviart@entrouvert.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <helper.h> -#include <lasso/lasso.h> -#include <com_entrouvert_lasso_LassoNode.h> - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoNode_destroy -(JNIEnv * env, jobject this){ - - void* ref = getCObject(env, this); - - lasso_node_destroy(ref); -} - diff --git a/java/src/c/com_entrouvert_lasso_LassoObject.c b/java/src/c/com_entrouvert_lasso_LassoObject.c deleted file mode 100644 index e1fb07f2..00000000 --- a/java/src/c/com_entrouvert_lasso_LassoObject.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * JLasso -- Java bindings for Lasso library - * - * Copyright (C) 2004 Entr'ouvert - * http://lasso.entrouvert.org - * - * Authors: Benjamin Poussin <poussin@codelutin.com> - * Emmanuel Raviart <eraviart@entrouvert.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <helper.h> -#include <lasso/lasso.h> -#include <com_entrouvert_lasso_LassoNode.h> diff --git a/java/src/c/com_entrouvert_lasso_LassoProfile.c b/java/src/c/com_entrouvert_lasso_LassoProfile.c deleted file mode 100644 index 970b17cb..00000000 --- a/java/src/c/com_entrouvert_lasso_LassoProfile.c +++ /dev/null @@ -1,245 +0,0 @@ -/* - * JLasso -- Java bindings for Lasso library - * - * Copyright (C) 2004 Entr'ouvert - * http://lasso.entrouvert.org - * - * Authors: Benjamin Poussin <poussin@codelutin.com> - * Emmanuel Raviart <eraviart@entrouvert.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <helper.h> -#include <lasso/lasso.h> -#include <com_entrouvert_lasso_LassoProfile.h> - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProfile_getCIdentity -(JNIEnv *env, jobject this) { - LassoProfile * profile; - char * fieldName = "identity"; - char * fieldType = "Lcom/entrouvert/lasso/LassoIdentity;"; - char * javaObjectClassName = "com/entrouvert/lasso/LassoIdentity"; - LassoIdentity *identity; - - profile = getCObject(env, this); - identity = lasso_profile_get_identity(profile); - checkAndSetField(env, this, fieldName, fieldType, javaObjectClassName, identity); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProfile_getCRequest -(JNIEnv *env, jobject this) { - LassoProfile * profile; - char * fieldName = "request"; - char * fieldType = "Lcom/entrouvert/lasso/LassoNode;"; - char * javaObjectClassName = "com/entrouvert/lasso/LassoNode"; - LassoNode *request; - - profile = getCObject(env, this); - request = profile->request; - - if (profile->request_type == lassoMessageTypeAuthnRequest) { - javaObjectClassName = "com/entrouvert/lasso/LassoAuthnRequest"; - } else if (profile->request_type == lassoMessageTypeRequest) { - javaObjectClassName = "com/entrouvert/lasso/LassoRequest"; - } else { - /* FIXME: Throw error */ - } - checkAndSetField(env, this, fieldName, fieldType, javaObjectClassName, request); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProfile_getCResponse -(JNIEnv *env, jobject this) { - LassoProfile * profile; - char * fieldName = "response"; - char * fieldType = "Lcom/entrouvert/lasso/LassoNode;"; - char * javaObjectClassName = "com/entrouvert/lasso/LassoNode"; - LassoNode *response; - - profile = getCObject(env, this); - response = profile->response; - - if (profile->response_type == lassoMessageTypeAuthnResponse) { - javaObjectClassName = "com/entrouvert/lasso/LassoAuthnResponse"; - } else if (profile->response_type == lassoMessageTypeResponse) { - javaObjectClassName = "com/entrouvert/lasso/LassoResponse"; - } else { - /* FIXME: Throw error */ - } - checkAndSetField(env, this, fieldName, fieldType, javaObjectClassName, response); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProfile_getCServer -(JNIEnv *env, jobject this) { - LassoProfile * profile; - char * fieldName = "server"; - char * fieldType = "Lcom/entrouvert/lasso/LassoServer;"; - char * javaObjectClassName = "com/entrouvert/lasso/LassoServer"; - LassoServer *server; - - profile = getCObject(env, this); - server = profile->server; - checkAndSetField(env, this, fieldName, fieldType, javaObjectClassName, server); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProfile_getCSession -(JNIEnv *env, jobject this) { - LassoProfile * profile; - char * fieldName = "session"; - char * fieldType = "Lcom/entrouvert/lasso/LassoSession;"; - char * javaObjectClassName = "com/entrouvert/lasso/LassoSession"; - LassoSession *session; - - profile = getCObject(env, this); - session = lasso_profile_get_session(profile); - - checkAndSetField(env, this, fieldName, fieldType, javaObjectClassName, session); -} - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfile_getMsgBody -(JNIEnv *env, jobject this) { - LassoProfile * profile; - char * result; - - profile = getCObject(env, this); - - result = profile->msg_body; - - return (*env)->NewStringUTF(env, result); -} - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfile_getMsgRelayState -(JNIEnv *env, jobject this) { - LassoProfile * profile; - char * result; - - profile = getCObject(env, this); - - result = profile->msg_relayState; - - return (*env)->NewStringUTF(env, result); -} - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfile_getMsgUrl -(JNIEnv *env, jobject this) { - LassoProfile * profile; - char * result; - - profile = getCObject(env, this); - - result = profile->msg_url; - - return (*env)->NewStringUTF(env, result); -} - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfile_getNameIdentifier -(JNIEnv *env, jobject this) { - LassoProfile * profile; - char *result; - - profile = getCObject(env, this); - - result = profile->nameIdentifier; - if (result == NULL) - return NULL; - return (*env)->NewStringUTF(env, result); -} - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfile_getProviderID -(JNIEnv *env, jobject this) { - LassoProfile * profile; - char * result; - - profile = getCObject(env, this); - - result = profile->remote_providerID; - - return (*env)->NewStringUTF(env, result); -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoProfile_getRequestType -(JNIEnv *env, jobject this) { - LassoProfile * profile; - char * result; - - profile = getCObject(env, this); - - return profile->request_type; -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoProfile_getResponseType -(JNIEnv *env, jobject this) { - LassoProfile * profile; - char * result; - - profile = getCObject(env, this); - - return profile->response_type; -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoProfile_setCIdentity -(JNIEnv *env, jobject this) { - char *fieldName = "identity"; - char *fieldType = "Lcom/entrouvert/lasso/LassoIdentity;"; - jobject _identity; - LassoIdentity *identity; - LassoProfile *profile; - - profile = getCObject(env, this); - _identity = getJavaObjectField(env, this, fieldName, fieldType); - identity = getCObject(env, _identity); - return lasso_profile_set_identity(profile, identity); -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoProfile_setCSession -(JNIEnv *env, jobject this) { - char *fieldName = "session"; - char *fieldType = "Lcom/entrouvert/lasso/LassoSession;"; - jobject _session; - LassoSession *session; - LassoProfile *profile; - - profile = getCObject(env, this); - _session = getJavaObjectField(env, this, fieldName, fieldType); - session = getCObject(env, _session); - return lasso_profile_set_session(profile, session); -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoProfile_setIdentityFromDump -(JNIEnv *env, jobject this, jstring _dump) { - int result; - LassoProfile *profile; - char *dump; - - profile = getCObject(env, this); - dump = (char*)(*env)->GetStringUTFChars(env, _dump, NULL); - result = lasso_profile_set_identity_from_dump(profile, dump); - (*env)->ReleaseStringUTFChars(env, _dump, dump); - return result; -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoProfile_setSessionFromDump -(JNIEnv *env, jobject this, jstring _dump) { - int result; - LassoProfile *profile; - char *dump; - - profile = getCObject(env, this); - dump = (char*)(*env)->GetStringUTFChars(env, _dump, NULL); - result = lasso_profile_set_session_from_dump(profile, dump); - (*env)->ReleaseStringUTFChars(env, _dump, dump); - return result; -} - diff --git a/java/src/c/com_entrouvert_lasso_LassoProvider.c b/java/src/c/com_entrouvert_lasso_LassoProvider.c deleted file mode 100644 index 092da270..00000000 --- a/java/src/c/com_entrouvert_lasso_LassoProvider.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * JLasso -- Java bindings for Lasso library - * - * Copyright (C) 2004 Entr'ouvert - * http://lasso.entrouvert.org - * - * Authors: Benjamin Poussin <poussin@codelutin.com> - * Emmanuel Raviart <eraviart@entrouvert.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <helper.h> -#include <lasso/lasso.h> -#include <com_entrouvert_lasso_LassoProvider.h> - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProvider_initMetadataField -(JNIEnv * env, jobject this){ - LassoProvider * provider; - char * fieldName = "metadata"; - char * fieldType = "Lcom/entrouvert/lasso/LassoNode;"; - char * javaObjectClassName = "com/entrouvert/lasso/LassoNode"; - LassoNode *cObject; - - provider = getCObject(env, this); - cObject = provider->metadata; - - checkAndSetField(env, this, fieldName, fieldType, javaObjectClassName, cObject); -} - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProvider_getPublicKeyField -(JNIEnv * env, jobject this){ - LassoProvider * provider; - char * result; - - provider = getCObject(env, this); - - result = provider->public_key; - - return (*env)->NewStringUTF(env, result); -} - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProvider_getCertificateField -(JNIEnv * env, jobject this){ - LassoProvider * provider; - char * result; - - provider = getCObject(env, this); - - result = provider->ca_certificate; - - return (*env)->NewStringUTF(env, result); -} - diff --git a/java/src/c/com_entrouvert_lasso_LassoRequest.c b/java/src/c/com_entrouvert_lasso_LassoRequest.c deleted file mode 100644 index d625a9c2..00000000 --- a/java/src/c/com_entrouvert_lasso_LassoRequest.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * JLasso -- Java bindings for Lasso library - * - * Copyright (C) 2004 Entr'ouvert - * http://lasso.entrouvert.org - * - * Authors: Benjamin Poussin <poussin@codelutin.com> - * Emmanuel Raviart <eraviart@entrouvert.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <helper.h> -#include <com_entrouvert_lasso_LassoRequest.h> -#include <lasso/lasso.h> - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoRequest_init -(JNIEnv * env, jobject this, jstring _assertionArtifact){ - LassoNode *request; - char *assertionArtifact; - - assertionArtifact = (char*)(*env)->GetStringUTFChars(env, _assertionArtifact, NULL); - - request = lasso_request_new(assertionArtifact); - - (*env)->ReleaseStringUTFChars(env, _assertionArtifact, assertionArtifact); - - setCObject(env, this, request); -} - diff --git a/java/src/c/com_entrouvert_lasso_LassoResponse.c b/java/src/c/com_entrouvert_lasso_LassoResponse.c deleted file mode 100644 index b2d0ea23..00000000 --- a/java/src/c/com_entrouvert_lasso_LassoResponse.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * JLasso -- Java bindings for Lasso library - * - * Copyright (C) 2004 Entr'ouvert - * http://lasso.entrouvert.org - * - * Authors: Benjamin Poussin <poussin@codelutin.com> - * Emmanuel Raviart <eraviart@entrouvert.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <helper.h> -#include <com_entrouvert_lasso_LassoResponse.h> -#include <lasso/lasso.h> - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoResponse_init -(JNIEnv * env, jobject this){ - LassoNode * response; - - response = lasso_response_new(); - - setCObject(env, this, response); -} diff --git a/java/src/c/com_entrouvert_lasso_LassoServer.c b/java/src/c/com_entrouvert_lasso_LassoServer.c deleted file mode 100644 index 45cd8615..00000000 --- a/java/src/c/com_entrouvert_lasso_LassoServer.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * JLasso -- Java bindings for Lasso library - * - * Copyright (C) 2004 Entr'ouvert - * http://lasso.entrouvert.org - * - * Authors: Benjamin Poussin <poussin@codelutin.com> - * Emmanuel Raviart <eraviart@entrouvert.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <helper.h> -#include <com_entrouvert_lasso_LassoServer.h> -#include <lasso/lasso.h> - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoServer_init -(JNIEnv * env, jobject this, jstring _metadata, - jstring _publicKey, - jstring _privateKey, - jstring _certificate, - jint _signatureMethod){ - - LassoServer *server; - char *metadata; - char *publicKey; - char *privateKey; - char *certificate; - - metadata = (char*)(*env)->GetStringUTFChars(env, _metadata, NULL); - publicKey = (char*)(*env)->GetStringUTFChars(env, _publicKey, NULL); - privateKey = (char*)(*env)->GetStringUTFChars(env, _privateKey, NULL); - certificate = (char*)(*env)->GetStringUTFChars(env, _certificate, NULL); - - server = lasso_server_new(metadata, publicKey, privateKey, - certificate, _signatureMethod); - - (*env)->ReleaseStringUTFChars(env, _metadata, metadata); - (*env)->ReleaseStringUTFChars(env, _publicKey, publicKey); - (*env)->ReleaseStringUTFChars(env, _privateKey, privateKey); - (*env)->ReleaseStringUTFChars(env, _certificate, certificate); - - setCObject(env, this, server); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoServer_initFromDump -(JNIEnv * env, jobject this, jstring _dump){ - LassoServer *server; - char *dump; - - dump = (char*)(*env)->GetStringUTFChars(env, _dump, NULL); - server = lasso_server_new_from_dump(dump); - - (*env)->ReleaseStringUTFChars(env, _dump, dump); - - setCObject(env, this, server); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoServer_addProvider -(JNIEnv * env, jobject this, jstring _metadata, - jstring _publicKey, - jstring _certificate){ - LassoServer *server; - char *metadata; - char *publicKey; - char *certificate; - - metadata = (char*)(*env)->GetStringUTFChars(env, _metadata, NULL); - publicKey = (char*)(*env)->GetStringUTFChars(env, _publicKey, NULL); - certificate = (char*)(*env)->GetStringUTFChars(env, _certificate, NULL); - - server = (LassoServer*)getCObject(env, this); - - lasso_server_add_provider(server, - metadata, publicKey, certificate); - - (*env)->ReleaseStringUTFChars(env, _metadata, metadata); - (*env)->ReleaseStringUTFChars(env, _publicKey, publicKey); - (*env)->ReleaseStringUTFChars(env, _certificate, certificate); -} - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoServer_dump -(JNIEnv * env, jobject this){ - LassoServer *server; - char* result; - - server = (LassoServer*)getCObject(env, this); - result = lasso_server_dump(server); - - return (*env)->NewStringUTF(env, result); -} - - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoServer_destroy -(JNIEnv * env, jobject this){ - - void* server = (LassoServer*)getCObject(env, this); - - lasso_server_destroy(server); -} - diff --git a/java/src/c/com_entrouvert_lasso_LassoSession.c b/java/src/c/com_entrouvert_lasso_LassoSession.c deleted file mode 100644 index cfd78d11..00000000 --- a/java/src/c/com_entrouvert_lasso_LassoSession.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * JLasso -- Java bindings for Lasso library - * - * Copyright (C) 2004 Entr'ouvert - * http://lasso.entrouvert.org - * - * Authors: Benjamin Poussin <poussin@codelutin.com> - * Emmanuel Raviart <eraviart@entrouvert.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <helper.h> -#include <com_entrouvert_lasso_LassoSession.h> -#include <lasso/lasso.h> - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoSession_init -(JNIEnv * env, jobject this){ - LassoSession *session; - - session = lasso_session_new(); - - setCObject(env, this, session); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoSession_initFromDump -(JNIEnv * env, jobject this, jstring _dump){ - LassoSession *session; - char *dump; - - dump = (char*)(*env)->GetStringUTFChars(env, _dump, NULL); - session = lasso_session_new_from_dump(dump); - - (*env)->ReleaseStringUTFChars(env, _dump, dump); - - setCObject(env, this, session); -} - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoSession_dump -(JNIEnv * env, jobject this){ - LassoSession *session; - char* result; - - session = (LassoSession*)getCObject(env, this); - result = lasso_session_dump(session); - - return (*env)->NewStringUTF(env, result); -} - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoSession_getAuthenticationMethod -(JNIEnv * env, jobject this, jstring _remoteProviderId){ - char *remoteProviderId = NULL; - char *result; - LassoSession* session; - - if (_remoteProviderId) - remoteProviderId = (char*)(*env)->GetStringUTFChars(env, _remoteProviderId, NULL); - - session = getCObject(env, this); - result = lasso_session_get_authentication_method(session, remoteProviderId); - - if (_remoteProviderId) - (*env)->ReleaseStringUTFChars(env, _remoteProviderId, remoteProviderId); - - return (*env)->NewStringUTF(env, result); -} - diff --git a/java/src/c/helper.c b/java/src/c/helper.c deleted file mode 100644 index 17e555c1..00000000 --- a/java/src/c/helper.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * JLasso -- Java bindings for Lasso library - * - * Copyright (C) 2004 Entr'ouvert - * http://lasso.entrouvert.org - * - * Authors: Benjamin Poussin <poussin@codelutin.com> - * Emmanuel Raviart <eraviart@entrouvert.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <helper.h> - -void checkAndSetField(JNIEnv *env, jobject this, char *fieldName, - char *fieldType, char *javaObjectClassName, void *cObject) { - jobject javaObject; - - /* check if changes are made */ - javaObject = getJavaObjectField(env, this, fieldName, fieldType); - if(isSameObject(env, javaObject, cObject)){ - /* no change made, do nothing */ - return; - } - - javaObject = instantiate(env, javaObjectClassName); - if(javaObject == NULL){ - return; /* exception thrown */ - } - - /* associate C object with JavaObject */ - setCObject(env, javaObject, cObject); - setJavaObjectField(env, this, fieldName, fieldType, javaObject); -} - -void * getCObject(JNIEnv * env, jobject this) { - return getObjectRef(env, this, "c_lasso_object"); -} - -jobject getJavaObjectField(JNIEnv * env, jobject this, const char * fieldName, - const char * fieldType) { - jclass clazz; - jfieldID fid; - jobject result; - - clazz = (*env)->GetObjectClass(env, this); - fid = (*env)->GetFieldID(env, clazz, fieldName, fieldType); - - result = (*env)->GetObjectField(env, this, fid); - return result; -} - -void * getObjectRef(JNIEnv * env, jobject this, const char * name) { - jclass clazz; - jfieldID fid; - jlong result; - - clazz = (*env)->GetObjectClass(env, this); - fid = (*env)->GetFieldID(env, clazz, name, "J"); - - result = (*env)->GetLongField(env, this, fid); - return (void*)(long)result; -} - -jobject instantiate(JNIEnv * env, const char * className){ - jclass clazz; - jmethodID constructor; - jobject result; - - clazz = (*env)->FindClass(env, className); - if (clazz == NULL) { - return NULL; /* exception thrown */ - } - constructor = (*env)->GetMethodID(env, clazz, "<init>", "()V"); - if (constructor == NULL) { - return NULL; /* exception thrown */ - } - - result = (*env)->NewObject(env, clazz, constructor); - (*env)->DeleteLocalRef(env, clazz); - - return result; -} - -int isSameObject(JNIEnv * env, jobject javaObject, void* cObject){ - return javaObject != NULL && cObject == getCObject(env, javaObject); -} - -void setCObject(JNIEnv * env, jobject this, void * cobject) { - setObjectRef(env, this, "c_lasso_object", cobject); -} - -void setJavaObjectField(JNIEnv * env, jobject this, const char * fieldName, const char * fieldType, jobject value){ - jclass clazz; - jfieldID fid; - - clazz = (*env)->GetObjectClass(env, this); - fid = (*env)->GetFieldID(env, clazz, fieldName, fieldType); - - (*env)->SetObjectField(env, this, fid, value); -} - -void setObjectRef(JNIEnv * env, jobject this, const char * name, void * objectRef) { - jclass clazz; - jfieldID fid; - jlong ref; - - clazz = (*env)->GetObjectClass(env, this); - fid = (*env)->GetFieldID(env, clazz, name, "J"); - - ref = (jlong)(long)objectRef; - (*env)->SetLongField(env, this, fid, ref); -} diff --git a/java/src/c/helper.h b/java/src/c/helper.h deleted file mode 100644 index 346574a1..00000000 --- a/java/src/c/helper.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * JLasso -- Java bindings for Lasso library - * - * Copyright (C) 2004 Entr'ouvert - * http://lasso.entrouvert.org - * - * Authors: Benjamin Poussin <poussin@codelutin.com> - * Emmanuel Raviart <eraviart@entrouvert.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _HELPER_H_ -#define _HELPER_H_ - -#include <jni.h> - -/** -* If field in Java object don't represent C object, then create new Java -* object representation for this C object and set java field. -*/ -void checkAndSetField(JNIEnv * env, jobject this, char * fieldName, - char * fieldType, char * javaObjectClassName, void * cObject); - -/** -* Get C object from Java object -*/ -void *getCObject(JNIEnv * env, jobject this); - -/** -* Get value of attribute, attribute must be Java object -*/ -jobject getJavaObjectField(JNIEnv * env, jobject this, const char * fieldName, - const char * fieldType); - -/** -* Get pointer object stored in java field -* @param name name of field used to store pointer -* @return object pointer -*/ -void *getObjectRef(JNIEnv * env, jobject this, const char * name); - -/** -* Instantiate a new object. Default constructor used -*/ -jobject instantiate(JNIEnv * env, const char * className); - -/** -* Check if Java object store the C object passed in parameter -*/ -int isSameObject(JNIEnv * env, jobject javaObject, void* cObject); - -/** -* Store C object in Java object -*/ -void setCObject(JNIEnv * env, jobject this, void * cobject); - -/** -* Store new value for Java object attribute, attribute must be Java object -*/ -void setJavaObjectField(JNIEnv * env, jobject this, const char * name, const char * fieldType, - jobject value); - -/** -* Store object pointer in java field -* @param name name of field used to store pointer -* @param objectRef pointer to store -*/ -void setObjectRef(JNIEnv * env, jobject this, const char * name, void * objectRef); - -#endif |
