String toString(boolean includePrivateCredentials){
  String s=ResourcesMgr.getString("Subject.");
  String suffix="";
synchronized (principals) {
    Iterator<Principal> pI=principals.iterator();
    while (pI.hasNext()) {
      Principal p=pI.next();
      suffix=suffix + ResourcesMgr.getString(".Principal.") + p.toString()+ ResourcesMgr.getString("NEWLINE");
    }
  }
synchronized (pubCredentials) {
    Iterator<Object> pI=pubCredentials.iterator();
    while (pI.hasNext()) {
      Object o=pI.next();
      suffix=suffix + ResourcesMgr.getString(".Public.Credential.") + o.toString()+ ResourcesMgr.getString("NEWLINE");
    }
  }
  if (includePrivateCredentials) {
synchronized (privCredentials) {
      Iterator<Object> pI=privCredentials.iterator();
      while (pI.hasNext()) {
        try {
          Object o=pI.next();
          suffix+=ResourcesMgr.getString(".Private.Credential.") + o.toString() + ResourcesMgr.getString("NEWLINE");
        }
 catch (        SecurityException se) {
          suffix+=ResourcesMgr.getString(".Private.Credential.inaccessible.");
          break;
        }
      }
    }
  }
  return s + suffix;
}

String toString ( boolean includePrivateCredentials ) { String s = ResourcesMgr . getString ( "Subject." ) ; String suffix = "" ; synchronized ( principals ) { Iterator < Principal > pI = principals . iterator ( ) ; while ( pI . hasNext ( ) ) { Principal p = pI . next ( ) ; suffix = suffix + ResourcesMgr . getString ( ".Principal." ) + p . toString ( ) + ResourcesMgr . getString ( "NEWLINE" ) ; } } synchronized ( pubCredentials ) { Iterator < Object > pI = pubCredentials . iterator ( ) ; while ( pI . hasNext ( ) ) { Object o = pI . next ( ) ; suffix = suffix + ResourcesMgr . getString ( ".Public.Credential." ) + o . toString ( ) + ResourcesMgr . getString ( "NEWLINE" ) ; } } if ( includePrivateCredentials ) { synchronized ( privCredentials ) { Iterator < Object > pI = privCredentials . iterator ( ) ; while ( pI . hasNext ( ) ) { try { Object o = pI . next ( ) ; suffix += ResourcesMgr . getString ( ".Private.Credential." ) + o . toString ( ) + ResourcesMgr . getString ( "NEWLINE" ) ; } catch ( SecurityException se ) { suffix += ResourcesMgr . getString ( ".Private.Credential.inaccessible." ) ; break ; } } } } return s + suffix ; }
package private convenience method to print out the subject without firing off a security check when trying to access the private credentials
