In an interview interviewer asked me why you need private credentials in JAAS
?
We can access both public credentials and private credentials like :
Set<Object> privateCredentials = subject.getPrivateCredentials();
Set<Object> publicCredentials = subject.getPublicCredentials();
Both ( privateCredentials
and publicCredentials
) are accessible and the way of access are same.
So, what is the significance for tow types of credentials?