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 | |
| 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')
37 files changed, 112 insertions, 2566 deletions
diff --git a/java/Makefile.am b/java/Makefile.am index f3740e31..adad418b 100644 --- a/java/Makefile.am +++ b/java/Makefile.am @@ -1,62 +1,92 @@ -NULL = -TARGET=target -#JAVAC=/usr/lib/kaffe/bin/javac -#JAVAH=/usr/lib/kaffe/bin/javah -#JAVAH_CLASSPATH_PREFIX=/usr/share/kaffe/Klasses.jar: -#JAR=/usr/lib/kaffe/bin/jar - - -C_SOURCE_DIR=../c -C_SOURCE=${wildcard ${C_SOURCE_DIR}/*.c} -C_BUILD_DIR=${C_SOURCE_DIR} -C_OBJECT=${C_SOURCE:.c=.o} -if MINGW -# JAVA_LDFLAGS=-L/usr/local/lib -lgobject-2.0-0 -lglib-2.0-0 -llasso - LASSO_DLL=${TARGET}/jlasso.dll -else -# JAVA_LDFLAGS=-lgobject-2.0 -lglib-2.0 -llasso - LASSO_SO=${TARGET}/libjlasso.so -endif - - -if MINGW -binary-c: ${LASSO_DLL} -else -binary-c: ${LASSO_SO} -endif - -if MINGW -mylibs = -L../win32/.libs -llasso -L/usr/local/lib -${LASSO_DLL}: - gcc -mno-cygwin -shared -o ${TARGET}/jlasso.dll \ - -Wl,--out-implib=${TARGET}/jlasso.a \ - -Wl,--add-stdcall-alias \ - -Wl,--export-all-symbols \ - -Wl,--enable-auto-import \ - -Wl,--whole-archive ${C_OBJECT} \ - -Wl,--no-whole-archive -lgobject-2.0-0 -lglib-2.0-0 ${mylibs} -else -mylibs = ../lasso/.libs/liblasso.so -${LASSO_SO}: - $(CC) -shared -lgobject-2.0 -lglib-2.0 $(mylibs) ${C_OBJECT} -o $@ -endif - -lib_LTLIBRARIES = \ - libjlasso.la \ - $(NULL) - -libjlasso_la_SOURCES = $(NULL) - -libjlasso_la_LIBADD = \ - binary-c \ - $(NULL) - -all-redirect: binary-c - -clean: clean-recursive - rm -fr ${TARGET} *~ *.log - - -EXTRA_DIST = $(NULL) -SUBDIRS = src $(NULL) +NULL= +# Define the java module +JAVA_MODULE=lasso +# Define java package name +JAVA_PACKAGE=com.entrouvert.lasso +# Define java Package directory, the tailing '/' is mandatory. +JAVA_PATH=com/entrouvert/lasso/ +CLASSPATH=. + +javalibdir=$(prefix)/lib/java +javasharedir=$(prefix)/share/java + +# Shared library. +javalib_LTLIBRARIES=libjlasso.la + +libjlasso_la_SOURCES=$(JAVA_MODULE)_wrap.c +libjlasso_la_CFLAGS=$(JDK_INCLUDES) $(LASSO_CFLAGS) +libjlasso_la_LIBADD=$(top_srcdir)/lasso/liblasso.la \ + $(LASSO_LIBS) \ + $(NULL) +libjlasso_la_LDFLAGS=-no-undefined -version-info @LASSO_VERSION_INFO@ \ + $(NULL) + +# Java package +javashare_DATA=lasso.jar +JAVA_JAR=lasso.jar + +SWIG_OUTPUTS=$(JAVA_PATH)$(JAVA_MODULE).java $(JAVA_MODULE)_wrap.c +JAVA_CRUFT=$(JAVA_PATH)$(JAVA_MODULE).class $(JAVA_MODULE)_wrap.o \ +$(JAVA_JAR) \ +$(JAVA_PATH)$(JAVA_MODULE)JNI.java + +# Sources file in order to beautifully (and so humanly) wrap lasso. +JAVA_SOURCE_FILES=$(NULL) + +# Bytecode version of the java source files. +JAVA_CLASS_FILES=$(NULL) + + +SUBDIRS= + +# The SWIG outputs are included in the distribution so SWIG is not +# required to use the Java interface +EXTRA_DIST= lasso-fragment.java \ + $(SWIG_OUTPUTS) + +CLEANFILES=$(JAVA_CRUFT) +MAINTAINERCLEANFILES=$(SWIG_OUTPUTS) + + +$(JAVA_MODULE)_wrap.c $(JAVA_PATH)$(JAVA_MODULE).java.in: $(srcdir)/../swig/Lasso.i + here=`pwd`; \ + cd $(JAVA_PATH); \ + $(SWIG) -v -java -noproxy -module $(JAVA_MODULE) -package $(JAVA_PACKAGE) -o $(JAVA_MODULE)_wrap.c $$here/$<; \ + if test -r $(JAVA_MODULE)JNI.java; then \ + echo "Fixing SWIG 1.3.15+ broken Java API"; \ + rm -f $(JAVA_MODULE).java SWIGTYPE_*; \ + sed -e 's/class $(JAVA_MODULE)JNI/public class $(JAVA_MODULE)/' $(JAVA_MODULE)JNI.java > $(JAVA_MODULE).java; \ + sed -e 's/$(JAVA_MODULE)JNI/$(JAVA_MODULE)/g' $(JAVA_MODULE)_wrap.c > $(JAVA_MODULE)_wrap.c.new; \ + rm -f $(JAVA_MODULE)_wrap.c $(JAVA_MODULE)JNI.java; \ + mv $(JAVA_MODULE)_wrap.c.new $(JAVA_MODULE)_wrap.c; \ + fi; \ + mv $(JAVA_MODULE)_wrap.c $$here; \ + mv $(JAVA_MODULE).java $(JAVA_MODULE).java.in + +# FIXME There must be a better way to do this with SWIG +$(JAVA_PATH)$(JAVA_MODULE).java: $(JAVA_PATH)$(JAVA_MODULE).java.in lasso-fragment.java + sed -e 's/^}//' $(JAVA_PATH)$(JAVA_MODULE).java.in > $(JAVA_PATH)$(JAVA_MODULE).java.tmp + cat $(JAVA_PATH)$(JAVA_MODULE).java.tmp lasso-fragment.java > $@ + echo "}" >> $@ + rm -f $(JAVA_PATH)$(JAVA_MODULE).java.tmp + + +clean-local: + rm -f *.class + +all-local: $(JAVA_JAR) + +$(JAVA_PATH)$(JAVA_MODULE).class: + $(JAVAC) $(JAVAC_FLAGS) $(JAVA_PATH)$(JAVA_MODULE).java + +$(JAVA_JAR): $(JAVA_PATH)$(JAVA_MODULE).class + rm -f $@ + jar cf $@ $(JAVA_PATH)$(JAVA_MODULE).class + +.deps/libjlasso_la-lasso_wrap.Plo: + echo "#dummy" > .deps/libjlasso_la-lasso_wrap.Plo + +.deps/com/entrouvert/lasso/lasso.Po: + mkdir -p .deps/com/entrouvert/lasso + echo "#dummy" > .deps/com/entrouvert/lasso/lasso.Po diff --git a/java/lasso-fragment.java b/java/lasso-fragment.java new file mode 100644 index 00000000..6e0d0542 --- /dev/null +++ b/java/lasso-fragment.java @@ -0,0 +1,21 @@ + // START lasso-fragment.java + + // + // -*- Mode: java; c-basic-offset: 4 -*- + // + // lasso-fragment.java - Inserted Java fragment for generated SWIG code + // + // $Id$ + // + + static + { + // Load a library whose "core" name is 'jlasso' + // Operating system specific stuff will be added to make from this an + // actual filename: Under Unix this will become libjlasso.so + // while under Windows it will likely become something like + // jlasso.dll + System.loadLibrary("jlasso"); + } + + // END lasso-fragment.java diff --git a/java/src/Makefile.am b/java/src/Makefile.am deleted file mode 100644 index 5676e64b..00000000 --- a/java/src/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS=java c 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 diff --git a/java/src/java/Makefile.am b/java/src/java/Makefile.am deleted file mode 100644 index d7ef7af3..00000000 --- a/java/src/java/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -TARGET=../../target -JAVA_BUILD_DIR=${TARGET}/classes -JAVA_PACKAGE=com.entrouvert.lasso -JAVA_SOURCE=${wildcard ${subst .,/,${JAVA_PACKAGE}}/*.java} -LASSO_JAR=${TARGET}/lasso.jar -C_SOURCE_DIR=../c -C_SOURCE=${wildcard ${C_SOURCE_DIR}/*.c} -JAVA_CLASSES=${addprefix ${JAVA_PACKAGE}., ${filter-out LassoTest, ${basename ${notdir ${JAVA_SOURCE}}}}} - -binary-java: - mkdir -p ${JAVA_BUILD_DIR} - ${JAVAC} ${JAVAC_FLAGS} -d ${JAVA_BUILD_DIR} ${JAVA_SOURCE} - ${JAR} cf ${LASSO_JAR} -C ${JAVA_BUILD_DIR} com - -generate-header: binary-java - ${JAVAH} ${JAVAH_FLAGS} -d ${C_SOURCE_DIR} -classpath ${JAVAH_CLASSPATH_PREFIX}${JAVA_BUILD_DIR} ${JAVA_CLASSES} - -all: generate-header - diff --git a/java/src/java/com/entrouvert/lasso/Lasso.java b/java/src/java/com/entrouvert/lasso/Lasso.java deleted file mode 100644 index bf359e4b..00000000 --- a/java/src/java/com/entrouvert/lasso/Lasso.java +++ /dev/null @@ -1,95 +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 - */ - -package com.entrouvert.lasso; - -public class Lasso { // Lasso - - static { - System.loadLibrary("jlasso"); - } - - /* HTTP methods used by Liberty Alliance */ - static final public int httpMethodGet = 1; - static final public int httpMethodPost = 2; - static final public int httpMethodRedirect = 3; - static final public int httpMethodSoap = 4; - - /* Consent types */ - static final public String libConsentObtained = "urn:liberty:consent:obtained"; - static final public String libConsentUnavailable = "urn:liberty:consent:unavailable"; - static final public String libConsentInapplicable = "urn:liberty:consent:inapplicable"; - - /* NameIDPolicy types */ - static final public String libNameIdPolicyTypeNone = "none"; - static final public String libNameIdPolicyTypeOneTime = "onetime"; - static final public String libNameIdPolicyTypeFederated = "federated"; - static final public String libNameIdPolicyTypeAny = "any"; - - /* Login ProtocolProfile types */ - static final public int loginProtocolProfileBrwsArt = 1; - static final public int loginProtocolProfileBrwsPost = 2; - - /* Message types */ - static final public int messageTypeNone = 0; - static final public int messageTypeAuthnRequest = 1; - static final public int messageTypeAuthnResponse = 2; - static final public int messageTypeRequest = 3; - static final public int messageTypeResponse = 4; - static final public int messageTypeArtifact = 5; - - /* Provider types */ - static final public int providerTypeSp = 1; - static final public int providerTypeIdp = 2; - - /* Request types */ - static final public int requestTypeLogin = 1; - static final public int requestTypeLogout = 2; - static final public int requestTypeFederationTermination = 3; - static final public int requestTypeRegisterNameIdentifier = 4; - static final public int requestTypeNameIdentifierMapping = 5; - - /* AuthenticationMethod types */ - static final public String samlAuthenticationMethodPassword = "urn:oasis:names:tc:SAML:1.0:am:password"; - static final public String samlAuthenticationMethodKerberos = "urn:ietf:rfc:1510"; - static final public String samlAuthenticationMethodSecureRemotePassword = "urn:ietf:rfc:2945"; - static final public String samlAuthenticationMethodHardwareToken = "urn:oasis:names:tc:SAML:1.0:am:HardwareToken"; - static final public String samlAuthenticationMethodSmartcardPki = "urn:ietf:rfc:2246"; - static final public String samlAuthenticationMethodSoftwarePki = "urn:oasis:names:tc:SAML:1.0:am:X509-PKI"; - static final public String samlAuthenticationMethodPgp = "urn:oasis:names:tc:SAML:1.0:am:PGP"; - static final public String samlAuthenticationMethodSPki = "urn:oasis:names:tc:SAML:1.0:am:SPKI"; - static final public String samlAuthenticationMethodXkms = "urn:oasis:names:tc:SAML:1.0:am:XKMS"; - static final public String samlAuthenticationMethodXmlDSig = "urn:ietf:rfc:3075"; - static final public String samlAuthenticationMethodUnspecified = "urn:oasis:names:tc:SAML:1.0:am:unspecified"; - - /* SignatureMethod types */ - static final public int signatureMethodRsaSha1 = 1; - static final public int signatureMethodDsaSha1 = 2; - - native static public int init(); - native static public int getRequestTypeFromSoapMsg(String soapRequestMsg); - native static public int shutdown(); - -} // Lasso - diff --git a/java/src/java/com/entrouvert/lasso/LassoAuthnRequest.java b/java/src/java/com/entrouvert/lasso/LassoAuthnRequest.java deleted file mode 100644 index 44f863b9..00000000 --- a/java/src/java/com/entrouvert/lasso/LassoAuthnRequest.java +++ /dev/null @@ -1,53 +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 - */ - -package com.entrouvert.lasso; - -public class LassoAuthnRequest extends LassoNode { // LassoAuthnRequest - private LassoAuthnRequest() {} - - public LassoAuthnRequest(String providerID){ - init(providerID); - } - - native protected void init(String providerID); - - // From LassoLibAuthnRequest - - native public void setAffiliationID(String affiliationId); - native public void setassertionConsumerServiceID(String assertionConsumerServiceID); - native public void setConsent(String consent); - native public void setForceAuthn(boolean val); - native public void setPassive(boolean val); - native public void setNameIdPolicy(String val); - native public void setProtocolProfile(String val); - native public void setproviderID(String val); - native public void setRelayState(String val); - - // not implemented - // lasso_lib_authn_request_set_requestAuthnContext(LassoLibRequestAuthnContext*) - // lasso_lib_authn_request_set_scoping(LassoLibScoping*) - -} // LassoAuthnRequest - diff --git a/java/src/java/com/entrouvert/lasso/LassoAuthnResponse.java b/java/src/java/com/entrouvert/lasso/LassoAuthnResponse.java deleted file mode 100644 index de0c7d70..00000000 --- a/java/src/java/com/entrouvert/lasso/LassoAuthnResponse.java +++ /dev/null @@ -1,43 +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 - */ - -package com.entrouvert.lasso; - -public class LassoAuthnResponse { // LassoAuthnResponse - private LassoAuthnResponse() {} - - public LassoAuthnResponse(String providerID, LassoNode request){ - init(providerID, request); - } - - native protected void init(String providerID, LassoNode request); - native public String getStatus(); - - // From LassoSamlpResponse - - native public void setContent(String val); - native public void setProviderID(String val); - native public void setRelayState(String val); -} // LassoAuthnResponse - diff --git a/java/src/java/com/entrouvert/lasso/LassoIdentity.java b/java/src/java/com/entrouvert/lasso/LassoIdentity.java deleted file mode 100644 index 8f82ccf6..00000000 --- a/java/src/java/com/entrouvert/lasso/LassoIdentity.java +++ /dev/null @@ -1,44 +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 - */ - -package com.entrouvert.lasso; - -public class LassoIdentity extends LassoObject { // LassoIdentity - - public LassoIdentity(){ - init(); - } - - public LassoIdentity(String dump){ - initFromDump(dump); - } - - native protected void init(); - - native protected void initFromDump(String dump); - - native public String dump(); - -} // LassoIdentity - diff --git a/java/src/java/com/entrouvert/lasso/LassoLogin.java b/java/src/java/com/entrouvert/lasso/LassoLogin.java deleted file mode 100644 index 4fb720f0..00000000 --- a/java/src/java/com/entrouvert/lasso/LassoLogin.java +++ /dev/null @@ -1,86 +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 - */ - -package com.entrouvert.lasso; - -public class LassoLogin extends LassoProfile { // LassoLogin - - public LassoLogin(LassoServer server){ - this.server = server; - init(server); - } - - public LassoLogin(LassoServer server, LassoIdentity identity, String dump){ - this.server = server; - this.identity = identity; - initFromDump(server, identity, dump); - } - - native protected void init(LassoServer server); - - native protected void initFromDump(LassoServer server, - LassoIdentity identity, - String dump); - - native public int acceptSso(); - - native public int buildArtifactMsg(boolean authenticationResult, - String authenticationMethod, - String reauthenticateOnOrAfter, - int method); - - native public int buildAuthnRequestMsg(); - - native public int buildAuthnResponseMsg(int authenticationResult, - String authenticationMethod, - String reauthenticateOnOrAfter); - - native public int buildRequestMsg(); - - native public String dump(); - - native public int initAuthnRequest(String providerId); - - native public int initFromAuthnRequestMsg(String authnRequestMsg, - int authnRequestMethod); - - native public int initRequest(String responseMsg, - int responseMethod); - - native public String getAssertionArtifact(); - - native public int getProtocolProfile(); - - native public String getResponseDump(); - - native public boolean mustAuthenticate(); - - native public int processAuthnResponseMsg(String authnResponseMsg); - - native public int processRequestMsg(String requestMsg); - - native public int processResponseMsg(String responseMsg); - -} // LassoLogin - diff --git a/java/src/java/com/entrouvert/lasso/LassoLogout.java b/java/src/java/com/entrouvert/lasso/LassoLogout.java deleted file mode 100644 index a500eae7..00000000 --- a/java/src/java/com/entrouvert/lasso/LassoLogout.java +++ /dev/null @@ -1,51 +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 - */ - -package com.entrouvert.lasso; - -public class LassoLogout extends LassoProfile { // LassoLogout - - public LassoLogout(LassoServer server, int providerType){ - this.server = server; - init(server, providerType); - } - - native protected void init(LassoServer server, int providerType); - - native public int buildRequestMsg(); - - native public int buildResponseMsg(); - - native public String getNextProviderId(); - - native public int initRequest(String providerId); - - native public int loadRequestMsg(String requestMsg, int requestMethod); - - native public int processRequest(); - - native public int processResponseMsg(String responseMsg, int responseMethod); - -} // LassoLogout - diff --git a/java/src/java/com/entrouvert/lasso/LassoNode.java b/java/src/java/com/entrouvert/lasso/LassoNode.java deleted file mode 100644 index 1d174700..00000000 --- a/java/src/java/com/entrouvert/lasso/LassoNode.java +++ /dev/null @@ -1,34 +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 - */ - -package com.entrouvert.lasso; - -public abstract class LassoNode extends LassoObject { // LassoNode - - protected void finalize(){ - destroy(); - } - native protected void destroy(); - -} // LassoNode diff --git a/java/src/java/com/entrouvert/lasso/LassoObject.java b/java/src/java/com/entrouvert/lasso/LassoObject.java deleted file mode 100644 index 521072ec..00000000 --- a/java/src/java/com/entrouvert/lasso/LassoObject.java +++ /dev/null @@ -1,33 +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 - */ - -package com.entrouvert.lasso; - -public abstract class LassoObject { // LassoObject - - /** used to store ref to the c real object, this field must be used only by native methode */ - protected long c_lasso_object = 0; - -} // LassoObject - diff --git a/java/src/java/com/entrouvert/lasso/LassoProfile.java b/java/src/java/com/entrouvert/lasso/LassoProfile.java deleted file mode 100644 index e2389f4a..00000000 --- a/java/src/java/com/entrouvert/lasso/LassoProfile.java +++ /dev/null @@ -1,101 +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 - */ - -package com.entrouvert.lasso; - -public abstract class LassoProfile extends LassoObject { // LassoProfile - protected LassoIdentity identity = null; - protected LassoNode request = null; - protected LassoNode response = null; - protected LassoServer server = null; - protected LassoSession session = null; - - native protected void getCIdentity(); - - native protected void getCRequest(); - - native protected void getCResponse(); - - native protected void getCServer(); - - native protected void getCSession(); - - native protected int setCIdentity(); - - native protected int setCSession(); - - public LassoIdentity getIdentity() { - getCIdentity(); - return identity; - } - - native public String getMsgBody(); - - native public String getMsgRelayState(); - - native public String getNameIdentifier(); - - native public String getMsgUrl(); - - native public String getProviderID(); - - public LassoNode getRequest() { - getCRequest(); - return request; - } - - native public int getRequestType(); - - public LassoNode getResponse() { - getCResponse(); - return response; - } - - native public int gettResponseType(); - - public LassoServer getServer() { - getCServer(); - return server; - } - - public LassoSession getSession() { - getCSession(); - return session; - } - - public int setIdentity(LassoIdentity identity) { - this.identity = identity; - return setCIdentity(); - } - - native public int setIdentityFromDump(String identityDump); - - public int setSession(LassoSession session) { - this.session = session; - return setCSession(); - } - - native public int setSessionFromDump(String sessionDump); - -} // LassoProfile diff --git a/java/src/java/com/entrouvert/lasso/LassoProvider.java b/java/src/java/com/entrouvert/lasso/LassoProvider.java deleted file mode 100644 index 7a8eb29a..00000000 --- a/java/src/java/com/entrouvert/lasso/LassoProvider.java +++ /dev/null @@ -1,43 +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 - */ - -package com.entrouvert.lasso; - -public class LassoProvider extends LassoObject { // LassoProvider - - protected LassoNode metadata = null; - - public LassoNode getMetadata(){ - if(metadata == null){ - initMetadataField(); - } - return metadata; - } - - native protected void initMetadataField(); - native protected String getPublicKeyField(); - native protected String getCertificateField(); - -} // LassoProvider - diff --git a/java/src/java/com/entrouvert/lasso/LassoRequest.java b/java/src/java/com/entrouvert/lasso/LassoRequest.java deleted file mode 100644 index 6ea2bb72..00000000 --- a/java/src/java/com/entrouvert/lasso/LassoRequest.java +++ /dev/null @@ -1,37 +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 - */ - -package com.entrouvert.lasso; - -public class LassoRequest extends LassoNode { // LassoRequest - private LassoRequest() {} - - public LassoRequest(String assertionArtifact){ - init(assertionArtifact); - } - - native protected void init(String assertionArtifact); - -} // LassoRequest - diff --git a/java/src/java/com/entrouvert/lasso/LassoResponse.java b/java/src/java/com/entrouvert/lasso/LassoResponse.java deleted file mode 100644 index 1faed5aa..00000000 --- a/java/src/java/com/entrouvert/lasso/LassoResponse.java +++ /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 - */ - -package com.entrouvert.lasso; - -public class LassoResponse extends LassoNode { // LassoResponse - - public LassoResponse(){ - init(); - } - - native public void init(); - -} // LassoResponse - diff --git a/java/src/java/com/entrouvert/lasso/LassoServer.java b/java/src/java/com/entrouvert/lasso/LassoServer.java deleted file mode 100644 index dcea192f..00000000 --- a/java/src/java/com/entrouvert/lasso/LassoServer.java +++ /dev/null @@ -1,70 +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 - */ - -package com.entrouvert.lasso; - -public class LassoServer extends LassoProvider { // LassoServer - public LassoServer(String metadataFilePath, - String publicKeyFilePath, - String privateKeyFilePath, - String certificateFilePath, - int lassoSignatureMethodRsaSha1){ - init(metadataFilePath, publicKeyFilePath, privateKeyFilePath, - certificateFilePath, lassoSignatureMethodRsaSha1); - } - - public LassoServer(String dump){ - initFromDump(dump); - } - - /** - * This method must set the c_lasso_object. If creation of LassoServer failed - * then c_lasso_object's value is 0. - */ - native protected void init(String metadataFilePath, - String publicKeyFilePath, - String privateKeyFilePath, - String certificateFilePath, - int lassoSignatureMethodRsaSha1); - - protected void finalize(){ - destroy(); - } - - /** - * This method must set the c_lasso_object. If creation of LassoServer failed - * then c_lasso_object's value is 0. - */ - native protected void initFromDump(String dump); - - native public void addProvider(String idpMetadataFilePath, - String idpPublicKeyFilePath, - String idpCaCertificateFilePath); - - native public String dump(); - - native protected void destroy(); - -} // LassoServer - diff --git a/java/src/java/com/entrouvert/lasso/LassoSession.java b/java/src/java/com/entrouvert/lasso/LassoSession.java deleted file mode 100644 index 29aa19a9..00000000 --- a/java/src/java/com/entrouvert/lasso/LassoSession.java +++ /dev/null @@ -1,46 +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 - */ - -package com.entrouvert.lasso; - -public class LassoSession extends LassoObject { // LassoSession - - public LassoSession(){ - init(); - } - - public LassoSession(String dump){ - initFromDump(dump); - } - - native protected void init(); - - native protected void initFromDump(String dump); - - native public String dump(); - - native public String getAuthenticationMethod(String remoteProviderId); - -} // LassoSession - diff --git a/java/src/java/com/entrouvert/lasso/LassoTest.java b/java/src/java/com/entrouvert/lasso/LassoTest.java deleted file mode 100644 index b5dd1162..00000000 --- a/java/src/java/com/entrouvert/lasso/LassoTest.java +++ /dev/null @@ -1,40 +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 - */ - -package com.entrouvert.lasso; - -public class LassoTest { // LassoTest - - static public void main(String [] args){ - System.out.println(System.mapLibraryName("jlasso")); - System.loadLibrary("jlasso"); - LassoServer ls = new LassoServer("", "", "", "", 0); - ls = new LassoServer(""); - System.gc(); - ls.addProvider("","",""); - System.out.println(ls.dump()); - } - -} // LassoTest - |
