How to read a PrivateKey from Keystore within a LoginModule

Apr 05, 2017 at 12:20 PM


avatar image
Former Member


i am trying to get a PrivateKey from TicketKeystore within a LoginModule for the Portal.

The following peace of code:

InitialContext ctx = new InitialContext(env);
KeystoreManager m_manager = (KeystoreManager) ctx.lookup("keystore");
KeyStore store = m_manager.getKeystore("TicketKeystore");
PrivateKey privateKey = (PrivateKey) store.getKey("SAPLogonTicketKeypair", "xyz".toCharArray());

, is working well in Portal Component Context if the current user is Administrator.

Within a LoginModule the current user is Guest so the line store.getKey("SAPLogonTicketKeypair", "xyz".toCharArray()); returns null.

Does anybody know how to make it work within the LoginModule context?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers

Skip to Content