Keytab principals list in Java

If you need to get a list of keytab principals through Java code, you can use the class:

KeyTab keyTab = KeyTab.getInstance(keyTabFilePath);
Set<String> principals =
      .map(s -> String.join("@", s.getNameString(), s.getRealmAsString()))
      .collect(Collectors.toSet());"principals={}", principals);
Telegram channel

If you still have any questions, feel free to ask me in the comments under this article or write me at

If I saved your day, you can support me 🤝

Leave a Reply

Your email address will not be published. Required fields are marked *