FileDocCategorySizeDatePackage
GetPrincipalInfoAction.javaAPI DocJBoss 4.2.14898Fri Jul 13 21:01:18 BST 2007org.jboss.resource.security

GetPrincipalInfoAction

public class GetPrincipalInfoAction extends Object
PrivilegedActions used by this package
author
Scott.Stark@jboss.org
version
$Revision: 57189 $

Fields Summary
Constructors Summary
Methods Summary
static char[]getCredential()

      char[] credential;
      if(System.getSecurityManager() == null)
      {
         credential = PrincipalActions.NON_PRIVILEGED.getCredential();
      }
      else
      {
         credential = PrincipalActions.PRIVILEGED.getCredential();
      }
      return credential;
   
private static char[]getPassword()

      Object credential = SecurityAssociation.getCredential();
      char[] password = null;
       if( credential instanceof char[] )
       {
          password = (char[]) credential;
       }
       else if( credential instanceof byte[] )
       {
          try
          {
             String tmp = new String((byte[]) credential, "UTF-8");
             password = tmp.toCharArray();
          }
          catch (UnsupportedEncodingException e)
          {
             throw new SecurityException(e.getMessage());
          }
       }
       else if( credential != null )
       {
          String tmp = credential.toString();
          password = tmp.toCharArray();
       }
      return password;
   
static java.security.PrincipalgetPrincipal()


       
       
       
   

     
   
      Principal principal;
      if(System.getSecurityManager() == null)
      {
         principal = PrincipalActions.NON_PRIVILEGED.getPrincipal();
      }
      else
      {
         principal = PrincipalActions.PRIVILEGED.getPrincipal();
      }
      return principal;
   
static org.jboss.security.RunAsIdentitypeekRunAsIdentity()

      if(System.getSecurityManager() == null)
      {
         return PrincipalActions.NON_PRIVILEGED.peek();
      }
      else
      {
         return PrincipalActions.PRIVILEGED.peek();
      }