Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
BEGIN LICENSE BLOCK ***** Version: CPL 1.0/GPL 2.0/LGPL 2.1 The contents of this file are subject to the Common Public License Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.eclipse.org/legal/cpl-v10.html Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. Copyright (C) 2008 Ola Bini <ola.bini@gmail.com> Alternatively, the contents of this file may be used under the terms of either of the GNU General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the LGPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of either the GPL or the LGPL, and not to allow others to use your version of this file under the terms of the CPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the GPL or the LGPL. If you do not delete the provisions above, a recipient may use your version of this file under the terms of any one of the CPL, the GPL or the LGPL. END LICENSE BLOCK ***
  
  package org.jruby.ext.openssl;
  
  import java.util.HashMap;
  import java.util.HashSet;
  import java.util.List;
  import java.util.Map;
  import java.util.Set;

Author(s):
Ola Bini
  
  public class CipherStrings {
      public final static String SSL2_TXT_DES_64_CFB64_WITH_MD5_1 = "DES-CFB-M1";
      public final static String SSL2_TXT_NULL_WITH_MD5 = "NULL-MD5";
      public final static String SSL2_TXT_RC4_128_WITH_MD5 = "RC4-MD5";
      public final static String SSL2_TXT_RC4_128_EXPORT40_WITH_MD5 = "EXP-RC4-MD5";
      public final static String SSL2_TXT_RC2_128_CBC_WITH_MD5 = "RC2-CBC-MD5";
      public final static String SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 = "EXP-RC2-CBC-MD5";
      public final static String SSL2_TXT_IDEA_128_CBC_WITH_MD5 = "IDEA-CBC-MD5";
      public final static String SSL2_TXT_DES_64_CBC_WITH_MD5 = "DES-CBC-MD5";
      public final static String SSL2_TXT_DES_64_CBC_WITH_SHA = "DES-CBC-SHA";
      public final static String SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5 = "DES-CBC3-MD5";
      public final static String SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA = "DES-CBC3-SHA";
      public final static String SSL2_TXT_RC4_64_WITH_MD5 = "RC4-64-MD5";
      public final static String SSL2_TXT_NULL = "NULL";
  
      public final static String SSL3_TXT_RSA_NULL_MD5 = "NULL-MD5";
      public final static String SSL3_TXT_RSA_NULL_SHA = "NULL-SHA";
      public final static String SSL3_TXT_RSA_RC4_40_MD5 = "EXP-RC4-MD5";
      public final static String SSL3_TXT_RSA_RC4_128_MD5 = "RC4-MD5";
      public final static String SSL3_TXT_RSA_RC4_128_SHA = "RC4-SHA";
      public final static String SSL3_TXT_RSA_RC2_40_MD5 = "EXP-RC2-CBC-MD5";
      public final static String SSL3_TXT_RSA_IDEA_128_SHA = "IDEA-CBC-SHA";
      public final static String SSL3_TXT_RSA_DES_40_CBC_SHA = "EXP-DES-CBC-SHA";
      public final static String SSL3_TXT_RSA_DES_64_CBC_SHA = "DES-CBC-SHA";
      public final static String SSL3_TXT_RSA_DES_192_CBC3_SHA = "DES-CBC3-SHA";
      public final static String SSL3_TXT_DH_DSS_DES_40_CBC_SHA = "EXP-DH-DSS-DES-CBC-SHA";
      public final static String SSL3_TXT_DH_DSS_DES_64_CBC_SHA = "DH-DSS-DES-CBC-SHA";
      public final static String SSL3_TXT_DH_DSS_DES_192_CBC3_SHA = "DH-DSS-DES-CBC3-SHA";
      public final static String SSL3_TXT_DH_RSA_DES_40_CBC_SHA = "EXP-DH-RSA-DES-CBC-SHA";
      public final static String SSL3_TXT_DH_RSA_DES_64_CBC_SHA = "DH-RSA-DES-CBC-SHA";
      public final static String SSL3_TXT_DH_RSA_DES_192_CBC3_SHA = "DH-RSA-DES-CBC3-SHA";
      public final static String SSL3_TXT_EDH_DSS_DES_40_CBC_SHA = "EXP-EDH-DSS-DES-CBC-SHA";
      public final static String SSL3_TXT_EDH_DSS_DES_64_CBC_SHA = "EDH-DSS-DES-CBC-SHA";
      public final static String SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA = "EDH-DSS-DES-CBC3-SHA";
      public final static String SSL3_TXT_EDH_RSA_DES_40_CBC_SHA = "EXP-EDH-RSA-DES-CBC-SHA";
      public final static String SSL3_TXT_EDH_RSA_DES_64_CBC_SHA = "EDH-RSA-DES-CBC-SHA";
      public final static String SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA = "EDH-RSA-DES-CBC3-SHA";
      public final static String SSL3_TXT_ADH_RC4_40_MD5 = "EXP-ADH-RC4-MD5";
      public final static String SSL3_TXT_ADH_RC4_128_MD5 = "ADH-RC4-MD5";
      public final static String SSL3_TXT_ADH_DES_40_CBC_SHA = "EXP-ADH-DES-CBC-SHA";
      public final static String SSL3_TXT_ADH_DES_64_CBC_SHA = "ADH-DES-CBC-SHA";
      public final static String SSL3_TXT_ADH_DES_192_CBC_SHA = "ADH-DES-CBC3-SHA";
      public final static String SSL3_TXT_FZA_DMS_NULL_SHA = "FZA-NULL-SHA";
      public final static String SSL3_TXT_FZA_DMS_FZA_SHA = "FZA-FZA-CBC-SHA";
      public final static String SSL3_TXT_FZA_DMS_RC4_SHA = "FZA-RC4-SHA";
      public final static String SSL3_TXT_KRB5_DES_64_CBC_SHA = "KRB5-DES-CBC-SHA";
      public final static String SSL3_TXT_KRB5_DES_192_CBC3_SHA = "KRB5-DES-CBC3-SHA";
      public final static String SSL3_TXT_KRB5_RC4_128_SHA = "KRB5-RC4-SHA";
      public final static String SSL3_TXT_KRB5_IDEA_128_CBC_SHA = "KRB5-IDEA-CBC-SHA";
      public final static String SSL3_TXT_KRB5_DES_64_CBC_MD5 = "KRB5-DES-CBC-MD5";
      public final static String SSL3_TXT_KRB5_DES_192_CBC3_MD5 = "KRB5-DES-CBC3-MD5";
      public final static String SSL3_TXT_KRB5_RC4_128_MD5 = "KRB5-RC4-MD5";
      public final static String SSL3_TXT_KRB5_IDEA_128_CBC_MD5 = "KRB5-IDEA-CBC-MD5";
      public final static String SSL3_TXT_KRB5_DES_40_CBC_SHA = "EXP-KRB5-DES-CBC-SHA";
      public final static String SSL3_TXT_KRB5_RC2_40_CBC_SHA = "EXP-KRB5-RC2-CBC-SHA";
      public final static String SSL3_TXT_KRB5_RC4_40_SHA = "EXP-KRB5-RC4-SHA";
      public final static String SSL3_TXT_KRB5_DES_40_CBC_MD5 = "EXP-KRB5-DES-CBC-MD5";
     public final static String SSL3_TXT_KRB5_RC2_40_CBC_MD5 = "EXP-KRB5-RC2-CBC-MD5";
     public final static String SSL3_TXT_KRB5_RC4_40_MD5 = "EXP-KRB5-RC4-MD5";
 
     public final static String SSL_TXT_NULL_WITH_MD5 = ;
     public final static String SSL_TXT_RC4_128_WITH_MD5 = ;
     
     public final static String SSL_TXT_KRB5_RC4_128_SHA = ;
     public final static String SSL_TXT_KRB5_RC4_128_MD5 = ;
 
     public final static String SSL_TXT_KRB5_RC4_40_SHA = ;
     public final static String SSL_TXT_KRB5_RC4_40_MD5 = ;
 
     public final static String SSL_TXT_LOW = "LOW";
     public final static String SSL_TXT_MEDIUM = "MEDIUM";
     public final static String SSL_TXT_HIGH = "HIGH";
     public final static String SSL_TXT_kFZA = "kFZA";
     public final static String SSL_TXT_aFZA = "aFZA";
     public final static String SSL_TXT_eFZA = "eFZA";
     public final static String SSL_TXT_FZA = "FZA";
 
     public final static String SSL_TXT_aNULL = "aNULL";
     public final static String SSL_TXT_eNULL = "eNULL";
     public final static String SSL_TXT_NULL = "NULL";
 
     public final static String SSL_TXT_kKRB5 = "kKRB5";
     public final static String SSL_TXT_aKRB5 = "aKRB5";
     public final static String SSL_TXT_KRB5 = "KRB5";
 
     public final static String SSL_TXT_kRSA = "kRSA";
     public final static String SSL_TXT_kDHr = "kDHr";
     public final static String SSL_TXT_kDHd = "kDHd";
     public final static String SSL_TXT_kEDH = "kEDH";
     public final static String SSL_TXT_aRSA = "aRSA";
     public final static String SSL_TXT_aDSS = "aDSS";
     public final static String SSL_TXT_aDH = "aDH";
     public final static String SSL_TXT_DSS = "DSS";
     public final static String SSL_TXT_DH = "DH";
     public final static String SSL_TXT_EDH = "EDH";
     public final static String SSL_TXT_ADH = "ADH";
     public final static String SSL_TXT_RSA = "RSA";
     public final static String SSL_TXT_DES = "DES";
     public final static String SSL_TXT_3DES = "3DES";
     public final static String SSL_TXT_RC4 = "RC4";
     public final static String SSL_TXT_RC2 = "RC2";
     public final static String SSL_TXT_IDEA = "IDEA";
     public final static String SSL_TXT_AES = "AES";
     public final static String SSL_TXT_MD5 = "MD5";
     public final static String SSL_TXT_SHA1 = "SHA1";
     public final static String SSL_TXT_SHA = "SHA";
     public final static String SSL_TXT_EXP = "EXP";
     public final static String SSL_TXT_EXPORT = "EXPORT";
     public final static String SSL_TXT_EXP40 = "EXPORT40";
     public final static String SSL_TXT_EXP56 = "EXPORT56";
     public final static String SSL_TXT_SSLV2 = "SSLv2";
     public final static String SSL_TXT_SSLV3 = "SSLv3";
     public final static String SSL_TXT_TLSV1 = "TLSv1";
     public final static String SSL_TXT_ALL = "ALL";
     public final static String SSL_TXT_ECC = "ECCdraft";
 
     public final static String SSL_TXT_CMPALL = "COMPLEMENTOFALL";
     public final static String SSL_TXT_CMPDEF = "COMPLEMENTOFDEFAULT";
 
     // "ALL:!aNULL:!eNULL:!SSLv2" is for OpenSSL 1.0.0 GA
     public final static String SSL_DEFAULT_CIPHER_LIST = "AES:ALL:!aNULL:!eNULL:+RC4:@STRENGTH";
 
     public final static long SSL_MKEY_MASK = 0x000000FFL;
     public final static long SSL_kRSA = 0x00000001L;
     public final static long SSL_kDHr = 0x00000002L;
     public final static long SSL_kDHd = 0x00000004L;
     public final static long SSL_kFZA = 0x00000008L;
     public final static long SSL_kEDH = 0x00000010L;
     public final static long SSL_kKRB5 = 0x00000020L;
     public final static long SSL_kECDH = 0x00000040L;
     public final static long SSL_kECDHE = 0x00000080L;
     public final static long SSL_aNULL = 0x00000800L;
     public final static long SSL_AUTH_MASK = 0x00007F00L;
     public final static long SSL_EDH = (|(^));
     public final static long SSL_aRSA = 0x00000100L;
     public final static long SSL_aDSS = 0x00000200L;
     public final static long SSL_DSS = ;
     public final static long SSL_aFZA = 0x00000400L;
     public final static long SSL_aDH = 0x00001000L;
     public final static long SSL_aKRB5 = 0x00002000L;
     public final static long SSL_aECDSA = 0x00004000L;
     public final static long SSL_eNULL = 0x00200000L;
     public final static long SSL_eFZA = 0x00100000L;
     public final static long SSL_NULL = ();
     public final static long SSL_ADH = (|);
     public final static long SSL_RSA = (|);
     public final static long SSL_DH = (||);
     public final static long SSL_ECDH = (|);
     public final static long SSL_FZA = (||);
     public final static long SSL_KRB5 = (|);
     public final static long SSL_ENC_MASK = 0x043F8000L;
     public final static long SSL_DES = 0x00008000L;
     public final static long SSL_3DES = 0x00010000L;
     public final static long SSL_RC4 = 0x00020000L;
     public final static long SSL_RC2 = 0x00040000L;
     public final static long SSL_IDEA = 0x00080000L;
     public final static long SSL_AES = 0x04000000L;
     public final static long SSL_MAC_MASK = 0x00c00000L;
     public final static long SSL_MD5 = 0x00400000L;
     public final static long SSL_SHA1 = 0x00800000L;
     public final static long SSL_SHA = ();
     public final static long SSL_SSL_MASK = 0x03000000L;
     public final static long SSL_SSLV2 = 0x01000000L;
     public final static long SSL_SSLV3 = 0x02000000L;
     public final static long SSL_TLSV1 = ;
     public final static long SSL_EXP_MASK = 0x00000003L;
     public final static long SSL_NOT_EXP = 0x00000001L;
     public final static long SSL_EXPORT = 0x00000002L;
     public final static long SSL_STRONG_MASK = 0x000000fcL;
     public final static long SSL_STRONG_NONE = 0x00000004L;
     public final static long SSL_EXP40 = 0x00000008L;
     public final static long SSL_MICRO = ();
     public final static long SSL_EXP56 = 0x00000010L;
     public final static long SSL_MINI = ();
     public final static long SSL_LOW = 0x00000020L;
     public final static long SSL_MEDIUM = 0x00000040L;
     public final static long SSL_HIGH = 0x00000080L;
     public final static long SSL_ALL = 0xffffffffL;
     public final static long SSL_ALL_CIPHERS = (|||);
     public final static long SSL_ALL_STRENGTHS = (|);
     public final static long SSL_PKEY_RSA_ENC = 0;
     public final static long SSL_PKEY_RSA_SIGN = 1;
     public final static long SSL_PKEY_DSA_SIGN = 2;
     public final static long SSL_PKEY_DH_RSA = 3;
     public final static long SSL_PKEY_DH_DSA = 4;
     public final static long SSL_PKEY_ECC = 5;
     public final static long SSL_PKEY_NUM = 6;
 
     public final static long SSL3_CK_RSA_NULL_MD5 = 0x03000001;
     public final static long SSL3_CK_RSA_NULL_SHA = 0x03000002;
     public final static long SSL3_CK_RSA_RC4_40_MD5 = 0x03000003;
     public final static long SSL3_CK_RSA_RC4_128_MD5 = 0x03000004;
     public final static long SSL3_CK_RSA_RC4_128_SHA = 0x03000005;
     public final static long SSL3_CK_RSA_RC2_40_MD5 = 0x03000006;
     public final static long SSL3_CK_RSA_IDEA_128_SHA = 0x03000007;
     public final static long SSL3_CK_RSA_DES_40_CBC_SHA = 0x03000008;
     public final static long SSL3_CK_RSA_DES_64_CBC_SHA = 0x03000009;
     public final static long SSL3_CK_RSA_DES_192_CBC3_SHA = 0x0300000A;
     public final static long SSL3_CK_DH_DSS_DES_40_CBC_SHA = 0x0300000B;
     public final static long SSL3_CK_DH_DSS_DES_64_CBC_SHA = 0x0300000C;
     public final static long SSL3_CK_DH_DSS_DES_192_CBC3_SHA = 0x0300000D;
     public final static long SSL3_CK_DH_RSA_DES_40_CBC_SHA = 0x0300000E;
     public final static long SSL3_CK_DH_RSA_DES_64_CBC_SHA = 0x0300000F;
     public final static long SSL3_CK_DH_RSA_DES_192_CBC3_SHA = 0x03000010;
     public final static long SSL3_CK_EDH_DSS_DES_40_CBC_SHA = 0x03000011;
     public final static long SSL3_CK_EDH_DSS_DES_64_CBC_SHA = 0x03000012;
     public final static long SSL3_CK_EDH_DSS_DES_192_CBC3_SHA = 0x03000013;
     public final static long SSL3_CK_EDH_RSA_DES_40_CBC_SHA = 0x03000014;
     public final static long SSL3_CK_EDH_RSA_DES_64_CBC_SHA = 0x03000015;
     public final static long SSL3_CK_EDH_RSA_DES_192_CBC3_SHA = 0x03000016;
     public final static long SSL3_CK_ADH_RC4_40_MD5 = 0x03000017;
     public final static long SSL3_CK_ADH_RC4_128_MD5 = 0x03000018;
     public final static long SSL3_CK_ADH_DES_40_CBC_SHA = 0x03000019;
     public final static long SSL3_CK_ADH_DES_64_CBC_SHA = 0x0300001A;
     public final static long SSL3_CK_ADH_DES_192_CBC_SHA = 0x0300001B;
     public final static long SSL3_CK_FZA_DMS_NULL_SHA = 0x0300001C;
     public final static long SSL3_CK_FZA_DMS_FZA_SHA = 0x0300001D;
     public final static long SSL3_CK_KRB5_DES_64_CBC_SHA = 0x0300001E;
     public final static long SSL3_CK_KRB5_DES_192_CBC3_SHA = 0x0300001F;
     public final static long SSL3_CK_KRB5_RC4_128_SHA = 0x03000020;
     public final static long SSL3_CK_KRB5_IDEA_128_CBC_SHA = 0x03000021;
     public final static long SSL3_CK_KRB5_DES_64_CBC_MD5 = 0x03000022;
     public final static long SSL3_CK_KRB5_DES_192_CBC3_MD5 = 0x03000023;
     public final static long SSL3_CK_KRB5_RC4_128_MD5 = 0x03000024;
     public final static long SSL3_CK_KRB5_IDEA_128_CBC_MD5 = 0x03000025;
     public final static long SSL3_CK_KRB5_DES_40_CBC_SHA = 0x03000026;
     public final static long SSL3_CK_KRB5_RC2_40_CBC_SHA = 0x03000027;
     public final static long SSL3_CK_KRB5_RC4_40_SHA = 0x03000028;
     public final static long SSL3_CK_KRB5_DES_40_CBC_MD5 = 0x03000029;
     public final static long SSL3_CK_KRB5_RC2_40_CBC_MD5 = 0x0300002A;
     public final static long SSL3_CK_KRB5_RC4_40_MD5 = 0x0300002B;
 
 
     public final static long TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_MD5 = 0x03000060;
     public final static long TLS1_CK_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 = 0x03000061;
     public final static long TLS1_CK_RSA_EXPORT1024_WITH_DES_CBC_SHA = 0x03000062;
     public final static long TLS1_CK_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA = 0x03000063;
     public final static long TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_SHA = 0x03000064;
     public final static long TLS1_CK_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA = 0x03000065;
     public final static long TLS1_CK_DHE_DSS_WITH_RC4_128_SHA = 0x03000066;
     public final static long TLS1_CK_RSA_WITH_AES_128_SHA = 0x0300002F;
     public final static long TLS1_CK_DH_DSS_WITH_AES_128_SHA = 0x03000030;
     public final static long TLS1_CK_DH_RSA_WITH_AES_128_SHA = 0x03000031;
     public final static long TLS1_CK_DHE_DSS_WITH_AES_128_SHA = 0x03000032;
     public final static long TLS1_CK_DHE_RSA_WITH_AES_128_SHA = 0x03000033;
     public final static long TLS1_CK_ADH_WITH_AES_128_SHA = 0x03000034;
     public final static long TLS1_CK_RSA_WITH_AES_256_SHA = 0x03000035;
     public final static long TLS1_CK_DH_DSS_WITH_AES_256_SHA = 0x03000036;
     public final static long TLS1_CK_DH_RSA_WITH_AES_256_SHA = 0x03000037;
     public final static long TLS1_CK_DHE_DSS_WITH_AES_256_SHA = 0x03000038;
     public final static long TLS1_CK_DHE_RSA_WITH_AES_256_SHA = 0x03000039;
     public final static long TLS1_CK_ADH_WITH_AES_256_SHA = 0x0300003A;
     public final static long TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA = 0x0300C001;
     public final static long TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA = 0x0300C002;
     public final static long TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA = 0x0300C003;
     public final static long TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA = 0x0300C004;
     public final static long TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA = 0x0300C005;
     public final static long TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA = 0x0300C006;
     public final static long TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA = 0x0300C007;
     public final static long TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA = 0x0300C008;
     public final static long TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = 0x0300C009;
     public final static long TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = 0x0300C00A;
     public final static long TLS1_CK_ECDH_RSA_WITH_NULL_SHA = 0x0300C00B;
     public final static long TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA = 0x0300C00C;
     public final static long TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA = 0x0300C00D;
     public final static long TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA = 0x0300C00E;
     public final static long TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA = 0x0300C00F;
     public final static long TLS1_CK_ECDHE_RSA_WITH_NULL_SHA = 0x0300C010;
     public final static long TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA = 0x0300C011;
     public final static long TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA = 0x0300C012;
     public final static long TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA = 0x0300C013;
     public final static long TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA = 0x0300C014;
     public final static long TLS1_CK_ECDH_anon_WITH_NULL_SHA = 0x0300C015;
     public final static long TLS1_CK_ECDH_anon_WITH_RC4_128_SHA = 0x0300C016;
     public final static long TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA = 0x0300C017;
     public final static long TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA = 0x0300C018;
     public final static long TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA = 0x0300C019;
 
     public final static String TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_MD5 = "EXP1024-RC4-MD5";
     public final static String TLS1_TXT_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 = "EXP1024-RC2-CBC-MD5";
     public final static String TLS1_TXT_RSA_EXPORT1024_WITH_DES_CBC_SHA = "EXP1024-DES-CBC-SHA";
     public final static String TLS1_TXT_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA = "EXP1024-DHE-DSS-DES-CBC-SHA";
     public final static String TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_SHA = "EXP1024-RC4-SHA";
     public final static String TLS1_TXT_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA = "EXP1024-DHE-DSS-RC4-SHA";
     public final static String TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA = "DHE-DSS-RC4-SHA";
     public final static String TLS1_TXT_RSA_WITH_AES_128_SHA = "AES128-SHA";
     public final static String TLS1_TXT_DH_DSS_WITH_AES_128_SHA = "DH-DSS-AES128-SHA";
     public final static String TLS1_TXT_DH_RSA_WITH_AES_128_SHA = "DH-RSA-AES128-SHA";
     public final static String TLS1_TXT_DHE_DSS_WITH_AES_128_SHA = "DHE-DSS-AES128-SHA";
     public final static String TLS1_TXT_DHE_RSA_WITH_AES_128_SHA = "DHE-RSA-AES128-SHA";
     public final static String TLS1_TXT_ADH_WITH_AES_128_SHA = "ADH-AES128-SHA";
     public final static String TLS1_TXT_RSA_WITH_AES_256_SHA = "AES256-SHA";
     public final static String TLS1_TXT_DH_DSS_WITH_AES_256_SHA = "DH-DSS-AES256-SHA";
     public final static String TLS1_TXT_DH_RSA_WITH_AES_256_SHA = "DH-RSA-AES256-SHA";
     public final static String TLS1_TXT_DHE_DSS_WITH_AES_256_SHA = "DHE-DSS-AES256-SHA";
     public final static String TLS1_TXT_DHE_RSA_WITH_AES_256_SHA = "DHE-RSA-AES256-SHA";
     public final static String TLS1_TXT_ADH_WITH_AES_256_SHA = "ADH-AES256-SHA";
     public final static String TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA = "ECDH-ECDSA-NULL-SHA";
     public final static String TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA = "ECDH-ECDSA-RC4-SHA";
     public final static String TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA = "ECDH-ECDSA-DES-CBC3-SHA";
     public final static String TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA = "ECDH-ECDSA-AES128-SHA";
     public final static String TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA = "ECDH-ECDSA-AES256-SHA";
     public final static String TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA = "ECDHE-ECDSA-NULL-SHA";
     public final static String TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA = "ECDHE-ECDSA-RC4-SHA";
     public final static String TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA = "ECDHE-ECDSA-DES-CBC3-SHA";
     public final static String TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = "ECDHE-ECDSA-AES128-SHA";
     public final static String TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = "ECDHE-ECDSA-AES256-SHA";
     public final static String TLS1_TXT_ECDH_RSA_WITH_NULL_SHA = "ECDH-RSA-NULL-SHA";
     public final static String TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA = "ECDH-RSA-RC4-SHA";
     public final static String TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA = "ECDH-RSA-DES-CBC3-SHA";
     public final static String TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA = "ECDH-RSA-AES128-SHA";
     public final static String TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA = "ECDH-RSA-AES256-SHA";
     public final static String TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA = "ECDHE-RSA-NULL-SHA";
     public final static String TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA = "ECDHE-RSA-RC4-SHA";
     public final static String TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA = "ECDHE-RSA-DES-CBC3-SHA";
     public final static String TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA = "ECDHE-RSA-AES128-SHA";
     public final static String TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA = "ECDHE-RSA-AES256-SHA";
     public final static String TLS1_TXT_ECDH_anon_WITH_NULL_SHA = "AECDH-NULL-SHA";
     public final static String TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA = "AECDH-RC4-SHA";
     public final static String TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA = "AECDH-DES-CBC3-SHA";
     public final static String TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA = "AECDH-AES128-SHA";
     public final static String TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA = "AECDH-AES256-SHA";
 
     public static class Def {
         public final int valid;
         public final String name;
         public final long id;
         public final long algorithms;
         public final long algo_strength;
         public final long algorithm2;
         public final int strength_bits;
         public final int alg_bits;
         public final long mask;
         public final long mask_strength;
         public String cipherSuite;
         public Def(int validString namelong idlong algorithmslong algo_strengthlong algorithm2int strength_bitsint alg_bitslong masklong mask_strength) {
             this. = valid;
             this. = name;
             this. = id;
             this. = algorithms;
             this. = algo_strength;
             this. = algorithm2;
             this. = strength_bits;
             this. = alg_bits;
             this. = mask;
             this. = mask_strength;
         }
 
         @Override
         public int hashCode() {
             return .hashCode();
         }
 
         @Override
         public boolean equals(Object other) {
             boolean ret = this == other;
             if(!ret && (other instanceof Def)) {
                 ret = this..equals(((Def)other).);
             }
             return ret;
         }
 
         @Override
         public String toString() {
             return "Cipher<" +  + ">";
         }
 
         // from ssl_cipher_apply_rule
         public boolean matches(Def current) {
 //            ma = mask & cp->algorithms;
 //            ma_s = mask_strength & cp->algo_strength;
 //
 //            // Select: if none of the mask bit was met from the
 //            // cipher or not all of the bits were met, the
 //            // selection does not apply.
 //            if (((ma == 0) && (ma_s == 0)) ||
 //                ((ma & algorithms) != ma) ||
 //                ((ma_s & algo_strength) != ma_s))
 //                continue; // does not apply
 //            }
             long ma =  & current.algorithms;
             long ma_s =  & current.algo_strength;
             if (((ma == 0) && (ma_s == 0)) ||
                     ((ma & ) != ma) ||
                     ((ma_s & ) != ma_s)) {
                 return false;
             }
             return true;
         }
     }
 
     public final static Map<StringDefDefinitions = new HashMap<StringDef>();
     public final static List<DefCiphers = new ArrayList<Def>();
     public final static Map<StringDefCipherNames = new HashMap<StringDef>();
     public final static Map<StringStringSuiteToOSSL = new HashMap<StringString>();
 
     public static List<DefgetMatchingCiphers(String strString[] all) {
         String[] parts = str.split("[:, ]+");
         List<DefcurrentList = new ArrayList<Def>();
         Set<Defremoved = new HashSet<Def>();
 
         for (String part : parts) {
             if (part.equals("@STRENGTH")) {
                 Collections.sort(currentListnew Comparator<Def>() {
 
                     public int compare(Def firstDef second) {
                         return second.strength_bits - first.strength_bits;
                     }
                 });
                 continue;
             }
             int index = 0;
             switch (part.charAt(0)) {
                 case '!':
                     index++;
                     break;
                 case '+':
                     index++;
                     break;
                 case '-':
                     index++;
                     break;
             }
             List<Defmatching = getMatching(part.substring(index), all);
             if (matching != null) {
                 if (index > 0) {
                     switch (part.charAt(0)) {
                         case '!':
                             currentList.removeAll(matching);
                             removed.addAll(matching);
                             break;
                         case '+':   // '+' is for moving entry in the list.
                             for (Def ele : matching) {
                                 if (!removed.contains(ele) && currentList.contains(ele)) {
                                     currentList.remove(ele);
                                     currentList.add(ele);
                                 }
                             }
                             break;
                         case '-':
                             currentList.removeAll(matching);
                             break;
                     }
                 } else {
                     for (Def ele : matching) {
                         if (!removed.contains(ele) && !currentList.contains(ele)) {
                             currentList.add(ele);
                         }
                     }
                 }
             }
         }
         return currentList;
     }
 
     private static List<DefgetMatching(String definitionString[] all) {
         List<Defmatching = null;
         for (String name : definition.split("[+]")) {
             Def pattern = .get(name);
             if (pattern != null) {
                 if (matching == null) {
                     matching = getMatchingPattern(patternall);
                 } else {
                     List<Defupdated = new ArrayList<Def>();
                     for (Def ele : getMatchingPattern(patternall)) {
                         if (matching.contains(ele)) {
                             updated.add(ele);
                         }
                     }
                     matching = updated;
                 }
             }
         }
         return matching;
     }
     
     private static List<DefgetMatchingPattern(Def patternString[] all) {
         List<Defmatching = new ArrayList<Def>();
         for (String entry : all) {
             String ossl = .get(entry);
             if (ossl != null) {
                 Def def = .get(ossl);
                 if (def != null) {
                     def.cipherSuite = entry;
                     if (pattern.matches(def)) {
                         matching.add(def);
                     }
                 }
             }
         }
         return matching;
     }
 
     private static void addAlias(String cipherSuiteString ossl) {
         .put(cipherSuiteossl);
     }
 
     static {
         .put(,new Def(0,, 0, & ~ & ~ & ~ ,0,0,0,,));
         .put(,new Def(0,,0,,0,0,0,0,,0));
         .put(,new Def(0,,0,, 0,0,0,0,,0));
         .put(,new Def(0,,0,,0,0,0,0,,0));
         .put(,new Def(0,,0,,  0,0,0,0,,0));
         .put(,new Def(0,,0,,  0,0,0,0,,0));
         .put(,new Def(0,,0,,  0,0,0,0,,0));
         .put(,new Def(0,,0,,  0,0,0,0,,0));
         .put(,new Def(0,,0,,  0,0,0,0,,0));
         .put(,new Def(0,,	0,,    0,0,0,0,,0));
         .put(,new Def(0,,	0,(|), 0,0,0,0,,0));
         .put(,new Def(0,,	0,,   0,0,0,0,|,0));
         .put(,new Def(0,,0,,0,0,0,0,,0));
         .put(,new Def(0,,0,,  0,0,0,0,,0));
         .put(,new Def(0,,0,,  0,0,0,0,,0));
         .put(,new Def(0,,0,,  0,0,0,0,,0));
         .put(,new Def(0,,0,,0,0,0,0,,0));
         .put(,new Def(0,, 0,,   0,0,0,0,,0));
         .put(,new Def(0,,	0,,   0,0,0,0,,0));
         .put(,new Def(0,,	0,,   0,0,0,0,,0));
         .put(,new Def(0,,0,,  0,0,0,0,,0));
         .put(,new Def(0,,	0,,   0,0,0,0,,0));
         .put(,new Def(0,,	0,,   0,0,0,0,,0));
         .put(,new Def(0,,0,,  0,0,0,0,,0));
         .put(,new Def(0,,0,,0,0,0,0,,0));
         .put(,new Def(0,,0,,  0,0,0,0,,0));
         .put(,new Def(0,,	0,,   0,0,0,0,,0));
         .put(,new Def(0,,	0,,   0,0,0,0,,0));
         .put(,new Def(0,,0,,  0,0,0,0,,0));
         .put(,new Def(0,,	0,,   0,0,0,0,,0));
         .put(,new Def(0,,0,,  0,0,0,0,,0));
         .put(,new Def(0,,	0,,   0,0,0,0,|,0));
         .put(,new Def(0,,	0,,   0,0,0,0,|,0));
         .put(,new Def(0,, 0,, 0,0,0,0,,0));
         .put(,new Def(0,, 0,, 0,0,0,0,,0));
         .put(,new Def(0,, 0,, 0,0,0,0,,0));
         .put(,new Def(0,   ,0, 0,, 0,0,0,0,));
         .put(,new Def(0,,0, 0,, 0,0,0,0,));
         .put(,new Def(0,, 0, 0, , 0,0,0,0,));
         .put(,new Def(0,, 0, 0, , 0,0,0,0,));
         .put(,new Def(0,,   0, 0,   , 0,0,0,0,));
         .put(,new Def(0,,0, 0,, 0,0,0,0,));
         .put(,new Def(0,,  0, 0,  , 0,0,0,0,));
 
         /* Cipher 01 */
         .add(new Def(
                             1,
                             ,
                             ,
                             || ||,
                             |,
                             0,
                             0,
                             0,
                             ,
                             
                             ));
         /* Cipher 02 */
         .add(new Def(
                             1,
                             ,
                             ,
                             || ||,
                             |,
                             0,
                             0,
                             0,
                             ,
                             
                             ));
         /* Cipher 03 */
         .add(new Def(
                             1,
                             ,
                             ,
                             ||  | |,
                             |,
                             0,
                             40,
                             128,
                             ,
                             
                             ));
         /* Cipher 04 */
         .add(new Def(
                             1,
                             ,
                             ,
                             ||  ||,
                             |,
                             0,
                             128,
                             128,
                             ,
                             
                             ));
         /* Cipher 05 */
         .add(new Def(
                             1,
                             ,
                             ,
                             ||  ||,
                             |,
                             0,
                             128,
                             128,
                             ,
                             
                             ));
         /* Cipher 06 */
         .add(new Def(
                             1,
                             ,
                             ,
                             ||  | |,
                             |,
                             0,
                             40,
                             128,
                             ,
                             
                             ));
         /* Cipher 07 */
         .add(new Def(
                             1,
                             ,
                             ,
                             || ||,
                             |,
                             0,
                             128,
                             128,
                             ,
                             
                             ));
         /* Cipher 08 */
         .add(new Def(
                             1,
                             ,
                             ,
                             ||||,
                             |,
                             0,
                             40,
                             56,
                             ,
                             
                             ));
         /* Cipher 09 */
         .add(new Def(
                             1,
                             ,
                             ,
                             ||  ||,
                             |,
                             0,
                             56,
                             56,
                             ,
                             
                             ));
         /* Cipher 0A */
         .add(new Def(
                             1,
                             ,
                             ,
                             || ||,
                             |,
                             0,
                             168,
                             168,
                             ,
                             
                             ));
         /* The DH ciphers */
         /* Cipher 0B */
         .add(new Def(
                             0,
                             ,
                             ,
                              ||||,
                             |,
                             0,
                             40,
                             56,
                             ,
                             
                             ));
         /* Cipher 0C */
         .add(new Def(
                             0,
                             ,
                             ,
                              ||  ||,
                             |,
                             0,
                             56,
                             56,
                             ,
                             
                             ));
         /* Cipher 0D */
         .add(new Def(
                             0,
                             ,
                             ,
                              || ||,
                             |,
                             0,
                             168,
                             168,
                             ,
                             
                             ));
         /* Cipher 0E */
         .add(new Def(
                             0,
                             ,
                             ,
                              ||||,
                             |,
                             0,
                             40,
                             56,
                             ,
                             
                             ));
         /* Cipher 0F */
         .add(new Def(
                             0,
                             ,
                             ,
                              ||  ||,
                             |,
                             0,
                             56,
                             56,
                             ,
                             
                             ));
         /* Cipher 10 */
         .add(new Def(
                             0,
                             ,
                             ,
                              || ||,
                             |,
                             0,
                             168,
                             168,
                             ,
                             
                             ));
 
         /* The Ephemeral DH ciphers */
         /* Cipher 11 */
         .add(new Def(
                             1,
                             ,
                             ,
                             ||||,
                             |,
                             0,
                             40,
                             56,
                             ,
                             
                             ));
         /* Cipher 12 */
         .add(new Def(
                             1,
                             ,
                             ,
                             ||  ||,
                             |,
                             0,
                             56,
                             56,
                             ,
                             
                             ));
         /* Cipher 13 */
         .add(new Def(
                             1,
                             ,
                             ,
                             || ||,
                             |,
                             0,
                             168,
                             168,
                             ,
                             
                             ));
         /* Cipher 14 */
         .add(new Def(
                             1,
                             ,
                             ,
                             ||||,
                             |,
                             0,
                             40,
                             56,
                             ,
                             
                             ));
         /* Cipher 15 */
         .add(new Def(
                             1,
                             ,
                             ,
                             ||  ||,
                             |,
                             0,
                             56,
                             56,
                             ,
                             
                             ));
         /* Cipher 16 */
         .add(new Def(
                             1,
                             ,
                             ,
                             || ||,
                             |,
                             0,
                             168,
                             168,
                             ,
                             
                             ));
         /* Cipher 17 */
         .add(new Def(
                             1,
                             ,
                             ,
                              ||  | |,
                             |,
                             0,
                             40,
                             128,
                             ,
                             
                             ));
         /* Cipher 18 */
         .add(new Def(
                             1,
                             ,