This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Security and the fly likes Exporting GSSCredential to byte array and vice versa Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "Exporting GSSCredential to byte array and vice versa" Watch "Exporting GSSCredential to byte array and vice versa" New topic
Author

Exporting GSSCredential to byte array and vice versa

varun srivastv
Greenhorn

Joined: Oct 15, 2009
Posts: 16
Hi,

I am implementing S4U protocol using GSS in java. Since java 7 does not support this protocol, I plan to write a JNI wrapper over the gss api methods in C that do not have equivalent in java.

As part of this I am writing a JNI over gss_acquire_cred_impersonate_name as described in
http://k5wiki.kerberos.org/wiki/Projects/Services4User#gss_acquire_cred_impersonate_name .

This method takes an previously populated input credential handle (gss_cred_id_t) and populates an output credential handle. In my java code I have a GSSCredential created which I need to pass to C function in form of gss_cred_id_t and convert the output credential handle from gss_cred_id_t back to GSSCredential for further use.

How can I export GSSCredential object to byte array and vice versa in order to communicate with the C function ?

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Exporting GSSCredential to byte array and vice versa