Retrieve the JAAS Security principals associated with a subject
To retrieve the principals associated with a subject, two methods are available: public Set getPrincipals() {...} public Set getPrincipals(Class c) {...} getPrincipals() returns all principals contained in the subject. getPrincipals(Class c) returns only those principals that are instances of class c or one of its subclasses. An empty set is returned if the subject has no matching principals. Note that the java.security.acl.Group interface is a subinterface of java.security.Principal, so an instance in the principals set may represent a logical grouping of other principals or groups of principals.