Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subject serializable

Status
Not open for further replies.

angktwap

Technical User
Apr 21, 2002
154
SG
Hi to all,

I am currently doing something with kerberos authentication. I currently trying to serialize the Subject which contains the credential, principal and etc.

Only the principal can be serialized as shown below

From java Docs:
This Subject class implements Serializable. While the Principals associated with the Subject are serialized, the credentials associated with the Subject are not. Note that the java.security.Principal class does not implement Serializable. Therefore all concrete Principal implementations associated with Subjects must implement Serializable.

Is there any to serialize the rest of the stuff in the Subject class?

Have been cracking my head for the past 1 week but no avail. Anyone has any ideas?

Thanks in advance

angktwap




 
The interface Principal is not serializable, but concreate implementations of it, such as KerberosPrincipal, are serializable. From looking at the class Subject, I would say that all inner objects are serializable, unless I'm missing something. What happens when you try to serialize the Subject object using an ObjectOutputStream, or RMI etc ?
 
I convert the Subject to a string and output it to the screen and it show something like this

Subject:
Principal: XXX@XX.com
Private Credential: Ticket (hex) =
xxxxxxx s...asd..as..asd..

02D1: F4 FF 82 A3 xx xx xx xx
Client Principal = xx@xx.com
Server Principal = krbtgt/xx.com@xx.com
Session Key = EncryptionKey: keyType=3 keyBytes (hex dump)=
0000: 81 F4 25 xx xx xx xx

Forwardable Ticket false
Forwarded Ticket false
Proxiable Ticket false
Proxy Ticket false
Postdated Ticket false
Renewable Ticket false
Initial Ticket false
Auth Time = Thur Mar 11 16:32:08 2004
Start Time = Thur Mar 11 16:32:08 2004
End Time = Fri Mar 13 02:00:08 2004
Renew Till = Null
Client Addresses Null


Then I send the Subject(not string representation)using ObjectOutputStream. At the other side I received the subject.
Convert the Subject to String to see what I have got:
Subject:
Principal: XXX@XX.com




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top