FileDocCategorySizeDatePackage
CipherInfo.javaAPI DocGlassfish v2 API5026Fri May 04 22:35:22 BST 2007com.sun.enterprise.security

CipherInfo

public class CipherInfo extends Object
This class represents the information associated to ciphers. It also maintains a HashMap from configName to CipherInfo.
author
Shing Wai Chan

Fields Summary
private static final short
SSL2
private static final short
SSL3
private static final short
TLS
private static final String[]
OLD_CIPHER_MAPPING
private static Map
ciphers
private String
configName
private String
cipherName
private short
protocolVersion
Constructors Summary
private CipherInfo(String configName, String cipherName, short protocolVersion)

param
configName name used in domain.xml, sun-acc.xml
param
cipherName name that may depends on backend
param
protocolVersion



     
        int len = OLD_CIPHER_MAPPING.length;
        for(int i=0; i<len; i++) {
            String nonStdName = OLD_CIPHER_MAPPING[i][0];
            String stdName    = OLD_CIPHER_MAPPING[i][1];
            ciphers.put(nonStdName, 
                new CipherInfo(nonStdName, stdName, (short)(SSL3|TLS)) );
        }

        SSLServerSocketFactory factory = 
                (SSLServerSocketFactory)SSLServerSocketFactory.getDefault();
        String[] supportedCiphers = factory.getDefaultCipherSuites();
        len = supportedCiphers.length;
        for(int i=0; i<len; i++) {
            String s = supportedCiphers[i];
            ciphers.put(s, new CipherInfo(s, s, (short)(SSL3|TLS)) );
        }
    
        this.configName = configName;
        this.cipherName = cipherName;
        this.protocolVersion = protocolVersion;
    
Methods Summary
public static com.sun.enterprise.security.CipherInfogetCipherInfo(java.lang.String configName)

        return (CipherInfo)ciphers.get(configName);
    
public java.lang.StringgetCipherName()

        return cipherName;
    
public java.lang.StringgetConfigName()

        return configName;
    
public booleanisSSL2()

        return (protocolVersion & SSL2) == SSL2;
    
public booleanisSSL3()

        return (protocolVersion & SSL3) == SSL3;
    
public booleanisTLS()

        return (protocolVersion & TLS) == TLS;