Posted By:
Johannes_Homuth
Posted On:
Thursday, July 3, 2008 07:03 AM
Hello Everyone, at first thank you for reading this post. I'd like to you use the gnome keyring manager to save/load Passwords out of my own java app. If tried things with dbus, but it seems not to work. Now I wanna to write my own wapper for the method calls to use the keyring manager. I started to write my Java class. It looks like this. /** * * @author jhomuth */ public class KeyRingConnector { public native void addPasswordToKeyRingManger(); public native boolean isKeyRingDaemonAvailable(); static { Runtime.getRuntime().load("/usr/lib/libdbus-1.so.3"); Runtime.getRuntime().load("/usr/lib/libglib-2.0.so.0");
More>>
Hello Everyone,
at first thank you for reading this post. I'd like to you use the gnome keyring manager to save/load Passwords out of my own java app. If tried things with dbus, but it seems not to work. Now I wanna to write my own wapper for the method calls to use the keyring manager. I started to write my Java class. It looks like this.
/**
*
* @author jhomuth
*/
public class KeyRingConnector {
public native void addPasswordToKeyRingManger();
public native boolean isKeyRingDaemonAvailable();
static
{
Runtime.getRuntime().load("/usr/lib/libdbus-1.so.3");
Runtime.getRuntime().load("/usr/lib/libglib-2.0.so.0");
Runtime.getRuntime().load("/lib/i686/cmov/libc.so.6");
Runtime.getRuntime().load("/usr/lib/libpcre.so.3");
Runtime.getRuntime().load("/lib/libselinux.so.1");
Runtime.getRuntime().load("/lib/ld-linux.so.2");
Runtime.getRuntime().load("/usr/lib/libgnome-keyring.so");
Runtime.getRuntime().load("/home/jhomuth/projekte/LDAP/src/de/sourcepark/ldap/KeyRingConnector.dll");
}
}
Furthermore I wrote the C Class which looks like this
//File: KeyRingConnector.c
#include "de_sourcepark_ldap_KeyRingConnector.h"
#include
#include
#include
#include
#include
JNIEXPORT void JNICALL Java_de_sourcepark_ldap_KeyRingConnector_addPasswordToKeyRingManger (JNIEnv *env, jobject obj)
{
printf("Damm I used JNI");
}
JNIEXPORT jboolean JNICALL Java_de_sourcepark_ldap_KeyRingConnector_isKeyRingDaemonAvailable (JNIEnv *env, jobject obj)
{
#define false 0
#define true (!false)
if(gnome_keyring_is_available())
{
return true;
}
else return false;
}
But when I wanna run my Programm I get an java.lang.UnsatisfiedLinkError
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: /home/jhomuth/projekte/LDAP/src/de/sourcepark/ldap/KeyRingConnector.dll: /home/jhomuth/projekte/LDAP/src/de/sourcepark/ldap/KeyRingConnector.dll: undefined symbol: gnome_keyring_is_available
I think I'm missing a Headerfile in my C Class or do I have to load another library?
Thx for help
<<Less