Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, the OpenSource J2EE webOS
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */ 
  package org.jboss.security.config;
  
  import java.security.Key;
Class that provides the Configuration for authentication, authorization, mapping info etc It also holds the information like JSSE keystores, keytypes and other crypto configuration

Author(s):
Anil Saldhana
Version:
$Revision$
Since:
Aug 28, 2006
 
 public class SecurityConfiguration
 {
   
Map of Application Policies keyed in by name
 
    private static String cipherAlgorithm;
    private static int iterationCount;
    private static String salt;
    private static String keyStoreType;
    private static String keyStoreURL;
    private static String keyStorePass;
    private static String trustStoreType;
    private static String trustStorePass;
    private static String trustStoreURL;
    private static Key cipherKey;
    private static AlgorithmParameterSpec cipherSpec;
    private static boolean deepCopySubjectMode;
   
   
Add an application policy

Parameters:
aP Application Policy
 
    public static void addApplicationPolicy(ApplicationPolicy aP)
    { 
       if(aP == null)
          throw new IllegalArgumentException("application policy is null");
       .put(aP.getName(), aP);
    }
   
   
Remove the Application Policy

Parameters:
name Name of the Policy
 
    public static void removeApplicationPolicy(String name)
    {
       .remove(name);
    }
   
   
Get an application policy

Parameters:
policyName Name of the Policy (such as "other", "messaging")
Returns:
 
    public static ApplicationPolicy getApplicationPolicy(String policyName)
    {
       return (ApplicationPolicy).get(policyName);
    } 
    
    public static String getCipherAlgorithm()
    {
       return ;
    }
    
    public static void setCipherAlgorithm(String ca)
    {
        = ca;
    }
    
    public static Key getCipherKey()
    {
       return ;
    }
    
    public static void setCipherKey(Key ca)
    {
        = ca;
    }
    
    public static AlgorithmParameterSpec getCipherSpec()
    {
       return ;
    }
    
    public static void setCipherSpec(AlgorithmParameterSpec aps)
    {
        = aps;
    }
   
   public static int getIterationCount()
   {
      return ;
   }

   
Set the iteration count used with PBE based on the keystore password.

Parameters:
count - an iteration count randomization value
 
   public static void setIterationCount(int count)
   {
       = count;
   }
   
   
   public static String getSalt()
   {
      return ;
   }
   
Set the salt used with PBE based on the keystore password.

Parameters:
salt - an 8 char randomization string
 
   public static void setSalt(String s)
   {
       = s;
   }

   
   
KeyStore implementation type being used.

Returns:
the KeyStore implementation type being used.
   public static String getKeyStoreType()
   {
      return ;
   }
   
Set the type of KeyStore implementation to use. This is passed to the KeyStore.getInstance() factory method.
   public static void setKeyStoreType(String type)
   {
       = type;
   } 
   
Get the KeyStore database URL string.
   public static String getKeyStoreURL()
   {
      return ;
   }
   
Set the KeyStore database URL string. This is used to obtain an InputStream to initialize the KeyStore.
   public static void setKeyStoreURL(String storeURL)
   {
       = storeURL;
   }
   
   
Get the credential string for the KeyStore.
    public static String getKeyStorePass()
    {
       return  ;
    }
   
   
Set the credential string for the KeyStore.
   public static void setKeyStorePass(String password)
   {
       = password;
   }

  
Get the type of the trust store

Returns:
the type of the trust store
 
  public static String getTrustStoreType()
  {
     return ;
  }
  
  
Set the type of the trust store

Parameters:
type - the trust store implementation type
 
  public static void setTrustStoreType(String type)
  {
      = type;
  }
  
  
Set the credential string for the trust store.
   public static String getTrustStorePass()
   {
      return ;
   }
  
  
Set the credential string for the trust store.
  public static void setTrustStorePass(String password)
  {
      = password;
  }
  
  
Get the trust store database URL string.
  public static String getTrustStoreURL()
  {
     return ;
  }
  
  
Set the trust store database URL string. This is used to obtain an InputStream to initialize the trust store.
  public static void setTrustStoreURL(String storeURL)
  {
      = storeURL;
  }
  public static boolean isDeepCopySubjectMode()
  {
     return ;
  }
  public static void setDeepCopySubjectMode(boolean dcsm)
  {
      = dcsm;
  }
New to GrepCode? Check out our FAQ X