Jessie.java 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /* Jessie.java -- JESSIE's JSSE provider.
  2. Copyright (C) 2006 Free Software Foundation, Inc.
  3. This file is a part of GNU Classpath.
  4. GNU Classpath is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or (at
  7. your option) any later version.
  8. GNU Classpath is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNU Classpath; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
  15. USA
  16. Linking this library statically or dynamically with other modules is
  17. making a combined work based on this library. Thus, the terms and
  18. conditions of the GNU General Public License cover the whole
  19. combination.
  20. As a special exception, the copyright holders of this library give you
  21. permission to link this library with independent modules to produce an
  22. executable, regardless of the license terms of these independent
  23. modules, and to copy and distribute the resulting executable under
  24. terms of your choice, provided that you also meet, for each linked
  25. independent module, the terms and conditions of the license of that
  26. module. An independent module is a module which is not derived from
  27. or based on this library. If you modify this library, you may extend
  28. this exception to your version of the library, but you are not
  29. obligated to do so. If you do not wish to do so, delete this
  30. exception statement from your version. */
  31. package gnu.javax.net.ssl.provider;
  32. import java.security.AccessController;
  33. import java.security.PrivilegedAction;
  34. import java.security.Provider;
  35. /**
  36. * This is the security provider for Jessie. It implements the following
  37. * algorithms:
  38. *
  39. * <pre>
  40. * {@link javax.net.ssl.SSLContext}.SSLv3
  41. * {@link javax.net.ssl.SSLContext}.SSL
  42. * {@link javax.net.ssl.SSLContext}.TLSv1
  43. * {@link javax.net.ssl.SSLContext}.TLS
  44. * {@link javax.net.ssl.KeyManagerFactory}.JessieX509
  45. * {@link javax.net.ssl.TrustManagerFactory}.JessieX509
  46. * {@link javax.net.ssl.TrustManagerFactory}.SRP
  47. * </pre>
  48. *
  49. */
  50. public class Jessie extends Provider
  51. {
  52. private static final long serialVersionUID = -1;
  53. public static final String VERSION = "2.0.0";
  54. public static final double VERSION_DOUBLE = 2.0;
  55. public Jessie()
  56. {
  57. super("Jessie", VERSION_DOUBLE,
  58. "Implementing TLSv1.1, with SSLv3, TLSv1.0 compatibility modes; "
  59. + "X.509 Key Manager Factory; "
  60. + "X.509 Trust Manager Factory; "
  61. + "SSLv3 MD5 and SHA Mac.");
  62. AccessController.doPrivileged(new PrivilegedAction<Object>()
  63. {
  64. public Object run()
  65. {
  66. put("SSLContext.TLSv1.1", SSLContextImpl.class.getName());
  67. put("Alg.Alias.SSLContext.SSLv3", "TLSv1.1");
  68. put("Alg.Alias.SSLContext.TLSv1", "TLSv1.1");
  69. put("Alg.Alias.SSLContext.TLSv1.0", "TLSv1.1");
  70. put("Alg.Alias.SSLContext.TLS", "TLSv1.1");
  71. put("Alg.Alias.SSLContext.SSL", "TLSv1.1");
  72. put("KeyManagerFactory.JessieX509", X509KeyManagerFactory.class.getName());
  73. put("TrustManagerFactory.JessieX509", X509TrustManagerFactory.class.getName());
  74. put("KeyManagerFactory.JessiePSK", PreSharedKeyManagerFactoryImpl.class.getName());
  75. //put("TrustManagerFactory.SRP", SRPTrustManagerFactory.class.getName());
  76. put("Mac.SSLv3HMac-MD5", SSLv3HMacMD5Impl.class.getName());
  77. put("Mac.SSLv3HMac-SHA", SSLv3HMacSHAImpl.class.getName());
  78. put("Signature.TLSv1.1-RSA", SSLRSASignatureImpl.class.getName());
  79. put("Alg.Alias.Signature.TLSv1-RSA", "TLSv1.1-RSA");
  80. put("Alg.Alias.Signature.SSLv3-RSA", "TLSv1.1-RSA");
  81. return null;
  82. }
  83. });
  84. }
  85. }