This discussion is archived
2 Replies Latest reply: Jun 6, 2011 9:25 PM by Weijun RSS

Why is sun.security.krb5.internal.ktab.KeyTab a singleton?

866870 Newbie
Currently Being Moderated
Hello,

while trying to find out why my server side application couldn't login 2 different javax.security.auth.Subject-s from 2 different keytab files, I found out it is because KeyTab is implemented as a singleton:

http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/security/krb5/internal/ktab/KeyTab.java

Now, I understand the argument that I should try to put all my Subjects into one keytab file, but forcing it (1 keytab per JVM process) with such implementation seems like a overkill - what if someone really needed to use multiple keytab files in the same JVM process?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points