PageRenderTime 52ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/rg/pkg/kaffe/libraries/javalib/gnu/crypto/jce/GnuCrypto.java

https://github.com/GunioRobot/MI424WR_GEN2_Rev_E-F
Java | 471 lines | 362 code | 29 blank | 80 comment | 0 complexity | b6a50385694f29190e2d428dc671cac5 MD5 | raw file
  1. package gnu.crypto.jce;
  2. // --------------------------------------------------------------------------
  3. // $Id: GnuCrypto.java,v 1.2 2005/10/20 12:04:38 alexa Exp $
  4. //
  5. // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
  6. //
  7. // This file is part of GNU Crypto.
  8. //
  9. // GNU Crypto is free software; you can redistribute it and/or modify it
  10. // under the terms of the GNU General Public License as published by the
  11. // Free Software Foundation; either version 2 of the License, or (at
  12. // your option) any later version.
  13. //
  14. // GNU Crypto is distributed in the hope that it will be useful, but
  15. // WITHOUT ANY WARRANTY; without even the implied warranty of
  16. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. // General Public License for more details.
  18. //
  19. // You should have received a copy of the GNU General Public License
  20. // along with this program; if not, write to the
  21. //
  22. // Free Software Foundation, Inc.,
  23. // 51 Franklin Street, Fifth Floor,
  24. // Boston, MA 02110-1301
  25. // USA
  26. //
  27. // Linking this library statically or dynamically with other modules is
  28. // making a combined work based on this library. Thus, the terms and
  29. // conditions of the GNU General Public License cover the whole
  30. // combination.
  31. //
  32. // As a special exception, the copyright holders of this library give
  33. // you permission to link this library with independent modules to
  34. // produce an executable, regardless of the license terms of these
  35. // independent modules, and to copy and distribute the resulting
  36. // executable under terms of your choice, provided that you also meet,
  37. // for each linked independent module, the terms and conditions of the
  38. // license of that module. An independent module is a module which is
  39. // not derived from or based on this library. If you modify this
  40. // library, you may extend this exception to your version of the
  41. // library, but you are not obligated to do so. If you do not wish to
  42. // do so, delete this exception statement from your version.
  43. //
  44. // --------------------------------------------------------------------------
  45. import gnu.crypto.Registry;
  46. import gnu.crypto.cipher.CipherFactory;
  47. import gnu.crypto.mac.MacFactory;
  48. import java.security.AccessController;
  49. import java.security.PrivilegedAction;
  50. import java.security.Provider;
  51. import java.util.HashSet;
  52. import java.util.Set;
  53. /**
  54. * <p>The GNU Crypto implementation of the Java Cryptographic Extension (JCE)
  55. * Provider.</p>
  56. *
  57. * @version $Revision: 1.2 $
  58. * @see java.security.Provider
  59. */
  60. public final class GnuCrypto extends Provider {
  61. // Constants and variables
  62. // -------------------------------------------------------------------------
  63. // Constructor(s)
  64. // -------------------------------------------------------------------------
  65. /**
  66. * <p>The <a href="http://www.gnu.org/software/gnu-crypto/">GNU Crypto</a>
  67. * Provider.</p>
  68. */
  69. public GnuCrypto() {
  70. super(Registry.GNU_CRYPTO, 2.1, "GNU Crypto JCE Provider");
  71. AccessController.doPrivileged(
  72. new PrivilegedAction() {
  73. public Object run() {
  74. // Cipher
  75. put("Cipher.ANUBIS", gnu.crypto.jce.cipher.AnubisSpi.class.getName());
  76. put("Cipher.ANUBIS ImplementedIn", "Software");
  77. put("Cipher.ARCFOUR", gnu.crypto.jce.cipher.ARCFourSpi.class.getName());
  78. put("Cipher.ARCFOUR ImplementedIn", "Software");
  79. put("Cipher.BLOWFISH", gnu.crypto.jce.cipher.BlowfishSpi.class.getName());
  80. put("Cipher.BLOWFISH ImplementedIn", "Software");
  81. put("Cipher.DES", gnu.crypto.jce.cipher.DESSpi.class.getName());
  82. put("Cipher.DES ImplementedIn", "Software");
  83. put("Cipher.KHAZAD", gnu.crypto.jce.cipher.KhazadSpi.class.getName());
  84. put("Cipher.KHAZAD ImplementedIn", "Software");
  85. put("Cipher.NULL", gnu.crypto.jce.cipher.NullCipherSpi.class.getName());
  86. put("Cipher.NULL ImplementedIn", "Software");
  87. put("Cipher.AES", gnu.crypto.jce.cipher.RijndaelSpi.class.getName());
  88. put("Cipher.AES ImplementedIn", "Software");
  89. put("Cipher.RIJNDAEL", gnu.crypto.jce.cipher.RijndaelSpi.class.getName());
  90. put("Cipher.RIJNDAEL ImplementedIn", "Software");
  91. put("Cipher.SERPENT", gnu.crypto.jce.cipher.SerpentSpi.class.getName());
  92. put("Cipher.SERPENT ImplementedIn", "Software");
  93. put("Cipher.SQUARE", gnu.crypto.jce.cipher.SquareSpi.class.getName());
  94. put("Cipher.SQUARE ImplementedIn", "Software");
  95. put("Cipher.TRIPLEDES", gnu.crypto.jce.cipher.TripleDESSpi.class.getName());
  96. put("Cipher.TRIPLEDES ImplementedIn", "Software");
  97. put("Cipher.TWOFISH", gnu.crypto.jce.cipher.TwofishSpi.class.getName());
  98. put("Cipher.TWOFISH ImplementedIn", "Software");
  99. put("Cipher.CAST5", gnu.crypto.jce.cipher.Cast5Spi.class.getName());
  100. put("Cipher.CAST5 ImplementedIn", "Software");
  101. // PBES2 ciphers.
  102. put("Cipher.PBEWithHMacHavalAndAES",
  103. gnu.crypto.jce.cipher.PBES2.HMacHaval.AES.class.getName());
  104. put("Cipher.PBEWithHMacHavalAndAnubis",
  105. gnu.crypto.jce.cipher.PBES2.HMacHaval.Anubis.class.getName());
  106. put("Cipher.PBEWithHMacHavalAndBlowfish",
  107. gnu.crypto.jce.cipher.PBES2.HMacHaval.Blowfish.class.getName());
  108. put("Cipher.PBEWithHMacHavalAndCast5",
  109. gnu.crypto.jce.cipher.PBES2.HMacHaval.Cast5.class.getName());
  110. put("Cipher.PBEWithHMacHavalAndDES",
  111. gnu.crypto.jce.cipher.PBES2.HMacHaval.DES.class.getName());
  112. put("Cipher.PBEWithHMacHavalAndKhazad",
  113. gnu.crypto.jce.cipher.PBES2.HMacHaval.Khazad.class.getName());
  114. put("Cipher.PBEWithHMacHavalAndSerpent",
  115. gnu.crypto.jce.cipher.PBES2.HMacHaval.Serpent.class.getName());
  116. put("Cipher.PBEWithHMacHavalAndSquare",
  117. gnu.crypto.jce.cipher.PBES2.HMacHaval.Square.class.getName());
  118. put("Cipher.PBEWithHMacHavalAndTripleDES",
  119. gnu.crypto.jce.cipher.PBES2.HMacHaval.TripleDES.class.getName());
  120. put("Cipher.PBEWithHMacHavalAndTwofish",
  121. gnu.crypto.jce.cipher.PBES2.HMacHaval.Twofish.class.getName());
  122. put("Cipher.PBEWithHMacMD2AndAES",
  123. gnu.crypto.jce.cipher.PBES2.HMacMD2.AES.class.getName());
  124. put("Cipher.PBEWithHMacMD2AndAnubis",
  125. gnu.crypto.jce.cipher.PBES2.HMacMD2.Anubis.class.getName());
  126. put("Cipher.PBEWithHMacMD2AndBlowfish",
  127. gnu.crypto.jce.cipher.PBES2.HMacMD2.Blowfish.class.getName());
  128. put("Cipher.PBEWithHMacMD2AndCast5",
  129. gnu.crypto.jce.cipher.PBES2.HMacMD2.Cast5.class.getName());
  130. put("Cipher.PBEWithHMacMD2AndDES",
  131. gnu.crypto.jce.cipher.PBES2.HMacMD2.DES.class.getName());
  132. put("Cipher.PBEWithHMacMD2AndKhazad",
  133. gnu.crypto.jce.cipher.PBES2.HMacMD2.Khazad.class.getName());
  134. put("Cipher.PBEWithHMacMD2AndSerpent",
  135. gnu.crypto.jce.cipher.PBES2.HMacMD2.Serpent.class.getName());
  136. put("Cipher.PBEWithHMacMD2AndSquare",
  137. gnu.crypto.jce.cipher.PBES2.HMacMD2.Square.class.getName());
  138. put("Cipher.PBEWithHMacMD2AndTripleDES",
  139. gnu.crypto.jce.cipher.PBES2.HMacMD2.TripleDES.class.getName());
  140. put("Cipher.PBEWithHMacMD2AndTwofish",
  141. gnu.crypto.jce.cipher.PBES2.HMacMD2.Twofish.class.getName());
  142. put("Cipher.PBEWithHMacMD4AndAES",
  143. gnu.crypto.jce.cipher.PBES2.HMacMD4.AES.class.getName());
  144. put("Cipher.PBEWithHMacMD4AndAnubis",
  145. gnu.crypto.jce.cipher.PBES2.HMacMD4.Anubis.class.getName());
  146. put("Cipher.PBEWithHMacMD4AndBlowfish",
  147. gnu.crypto.jce.cipher.PBES2.HMacMD4.Blowfish.class.getName());
  148. put("Cipher.PBEWithHMacMD4AndCast5",
  149. gnu.crypto.jce.cipher.PBES2.HMacMD4.Cast5.class.getName());
  150. put("Cipher.PBEWithHMacMD4AndDES",
  151. gnu.crypto.jce.cipher.PBES2.HMacMD4.DES.class.getName());
  152. put("Cipher.PBEWithHMacMD4AndKhazad",
  153. gnu.crypto.jce.cipher.PBES2.HMacMD4.Khazad.class.getName());
  154. put("Cipher.PBEWithHMacMD4AndSerpent",
  155. gnu.crypto.jce.cipher.PBES2.HMacMD4.Serpent.class.getName());
  156. put("Cipher.PBEWithHMacMD4AndSquare",
  157. gnu.crypto.jce.cipher.PBES2.HMacMD4.Square.class.getName());
  158. put("Cipher.PBEWithHMacMD4AndTripleDES",
  159. gnu.crypto.jce.cipher.PBES2.HMacMD4.TripleDES.class.getName());
  160. put("Cipher.PBEWithHMacMD4AndTwofish",
  161. gnu.crypto.jce.cipher.PBES2.HMacMD4.Twofish.class.getName());
  162. put("Cipher.PBEWithHMacMD5AndAES",
  163. gnu.crypto.jce.cipher.PBES2.HMacMD5.AES.class.getName());
  164. put("Cipher.PBEWithHMacMD5AndAnubis",
  165. gnu.crypto.jce.cipher.PBES2.HMacMD5.Anubis.class.getName());
  166. put("Cipher.PBEWithHMacMD5AndBlowfish",
  167. gnu.crypto.jce.cipher.PBES2.HMacMD5.Blowfish.class.getName());
  168. put("Cipher.PBEWithHMacMD5AndCast5",
  169. gnu.crypto.jce.cipher.PBES2.HMacMD5.Cast5.class.getName());
  170. put("Cipher.PBEWithHMacMD5AndDES",
  171. gnu.crypto.jce.cipher.PBES2.HMacMD5.DES.class.getName());
  172. put("Cipher.PBEWithHMacMD5AndKhazad",
  173. gnu.crypto.jce.cipher.PBES2.HMacMD5.Khazad.class.getName());
  174. put("Cipher.PBEWithHMacMD5AndSerpent",
  175. gnu.crypto.jce.cipher.PBES2.HMacMD5.Serpent.class.getName());
  176. put("Cipher.PBEWithHMacMD5AndSquare",
  177. gnu.crypto.jce.cipher.PBES2.HMacMD5.Square.class.getName());
  178. put("Cipher.PBEWithHMacMD5AndTripleDES",
  179. gnu.crypto.jce.cipher.PBES2.HMacMD5.TripleDES.class.getName());
  180. put("Cipher.PBEWithHMacMD5AndTwofish",
  181. gnu.crypto.jce.cipher.PBES2.HMacMD5.Twofish.class.getName());
  182. put("Cipher.PBEWithHMacSHA1AndAES",
  183. gnu.crypto.jce.cipher.PBES2.HMacSHA1.AES.class.getName());
  184. put("Cipher.PBEWithHMacSHA1AndAnubis",
  185. gnu.crypto.jce.cipher.PBES2.HMacSHA1.Anubis.class.getName());
  186. put("Cipher.PBEWithHMacSHA1AndBlowfish",
  187. gnu.crypto.jce.cipher.PBES2.HMacSHA1.Blowfish.class.getName());
  188. put("Cipher.PBEWithHMacSHA1AndCast5",
  189. gnu.crypto.jce.cipher.PBES2.HMacSHA1.Cast5.class.getName());
  190. put("Cipher.PBEWithHMacSHA1AndDES",
  191. gnu.crypto.jce.cipher.PBES2.HMacSHA1.DES.class.getName());
  192. put("Cipher.PBEWithHMacSHA1AndKhazad",
  193. gnu.crypto.jce.cipher.PBES2.HMacSHA1.Khazad.class.getName());
  194. put("Cipher.PBEWithHMacSHA1AndSerpent",
  195. gnu.crypto.jce.cipher.PBES2.HMacSHA1.Serpent.class.getName());
  196. put("Cipher.PBEWithHMacSHA1AndSquare",
  197. gnu.crypto.jce.cipher.PBES2.HMacSHA1.Square.class.getName());
  198. put("Cipher.PBEWithHMacSHA1AndTripleDES",
  199. gnu.crypto.jce.cipher.PBES2.HMacSHA1.TripleDES.class.getName());
  200. put("Cipher.PBEWithHMacSHA1AndTwofish",
  201. gnu.crypto.jce.cipher.PBES2.HMacSHA1.Twofish.class.getName());
  202. put("Cipher.PBEWithHMacSHA256AndAES",
  203. gnu.crypto.jce.cipher.PBES2.HMacSHA256.AES.class.getName());
  204. put("Cipher.PBEWithHMacSHA256AndAnubis",
  205. gnu.crypto.jce.cipher.PBES2.HMacSHA256.Anubis.class.getName());
  206. put("Cipher.PBEWithHMacSHA256AndBlowfish",
  207. gnu.crypto.jce.cipher.PBES2.HMacSHA256.Blowfish.class.getName());
  208. put("Cipher.PBEWithHMacSHA256AndCast5",
  209. gnu.crypto.jce.cipher.PBES2.HMacSHA256.Cast5.class.getName());
  210. put("Cipher.PBEWithHMacSHA256AndDES",
  211. gnu.crypto.jce.cipher.PBES2.HMacSHA256.DES.class.getName());
  212. put("Cipher.PBEWithHMacSHA256AndKhazad",
  213. gnu.crypto.jce.cipher.PBES2.HMacSHA256.Khazad.class.getName());
  214. put("Cipher.PBEWithHMacSHA256AndSerpent",
  215. gnu.crypto.jce.cipher.PBES2.HMacSHA256.Serpent.class.getName());
  216. put("Cipher.PBEWithHMacSHA256AndSquare",
  217. gnu.crypto.jce.cipher.PBES2.HMacSHA256.Square.class.getName());
  218. put("Cipher.PBEWithHMacSHA256AndTripleDES",
  219. gnu.crypto.jce.cipher.PBES2.HMacSHA256.TripleDES.class.getName());
  220. put("Cipher.PBEWithHMacSHA256AndTwofish",
  221. gnu.crypto.jce.cipher.PBES2.HMacSHA256.Twofish.class.getName());
  222. put("Cipher.PBEWithHMacSHA384AndAES",
  223. gnu.crypto.jce.cipher.PBES2.HMacSHA384.AES.class.getName());
  224. put("Cipher.PBEWithHMacSHA384AndAnubis",
  225. gnu.crypto.jce.cipher.PBES2.HMacSHA384.Anubis.class.getName());
  226. put("Cipher.PBEWithHMacSHA384AndBlowfish",
  227. gnu.crypto.jce.cipher.PBES2.HMacSHA384.Blowfish.class.getName());
  228. put("Cipher.PBEWithHMacSHA384AndCast5",
  229. gnu.crypto.jce.cipher.PBES2.HMacSHA384.Cast5.class.getName());
  230. put("Cipher.PBEWithHMacSHA384AndDES",
  231. gnu.crypto.jce.cipher.PBES2.HMacSHA384.DES.class.getName());
  232. put("Cipher.PBEWithHMacSHA384AndKhazad",
  233. gnu.crypto.jce.cipher.PBES2.HMacSHA384.Khazad.class.getName());
  234. put("Cipher.PBEWithHMacSHA384AndSerpent",
  235. gnu.crypto.jce.cipher.PBES2.HMacSHA384.Serpent.class.getName());
  236. put("Cipher.PBEWithHMacSHA384AndSquare",
  237. gnu.crypto.jce.cipher.PBES2.HMacSHA384.Square.class.getName());
  238. put("Cipher.PBEWithHMacSHA384AndTripleDES",
  239. gnu.crypto.jce.cipher.PBES2.HMacSHA384.TripleDES.class.getName());
  240. put("Cipher.PBEWithHMacSHA384AndTwofish",
  241. gnu.crypto.jce.cipher.PBES2.HMacSHA384.Twofish.class.getName());
  242. put("Cipher.PBEWithHMacSHA512AndAES",
  243. gnu.crypto.jce.cipher.PBES2.HMacSHA512.AES.class.getName());
  244. put("Cipher.PBEWithHMacSHA512AndAnubis",
  245. gnu.crypto.jce.cipher.PBES2.HMacSHA512.Anubis.class.getName());
  246. put("Cipher.PBEWithHMacSHA512AndBlowfish",
  247. gnu.crypto.jce.cipher.PBES2.HMacSHA512.Blowfish.class.getName());
  248. put("Cipher.PBEWithHMacSHA512AndCast5",
  249. gnu.crypto.jce.cipher.PBES2.HMacSHA512.Cast5.class.getName());
  250. put("Cipher.PBEWithHMacSHA512AndDES",
  251. gnu.crypto.jce.cipher.PBES2.HMacSHA512.DES.class.getName());
  252. put("Cipher.PBEWithHMacSHA512AndKhazad",
  253. gnu.crypto.jce.cipher.PBES2.HMacSHA512.Khazad.class.getName());
  254. put("Cipher.PBEWithHMacSHA512AndSerpent",
  255. gnu.crypto.jce.cipher.PBES2.HMacSHA512.Serpent.class.getName());
  256. put("Cipher.PBEWithHMacSHA512AndSquare",
  257. gnu.crypto.jce.cipher.PBES2.HMacSHA512.Square.class.getName());
  258. put("Cipher.PBEWithHMacSHA512AndTripleDES",
  259. gnu.crypto.jce.cipher.PBES2.HMacSHA512.TripleDES.class.getName());
  260. put("Cipher.PBEWithHMacSHA512AndTwofish",
  261. gnu.crypto.jce.cipher.PBES2.HMacSHA512.Twofish.class.getName());
  262. put("Cipher.PBEWithHMacTigerAndAES",
  263. gnu.crypto.jce.cipher.PBES2.HMacTiger.AES.class.getName());
  264. put("Cipher.PBEWithHMacTigerAndAnubis",
  265. gnu.crypto.jce.cipher.PBES2.HMacTiger.Anubis.class.getName());
  266. put("Cipher.PBEWithHMacTigerAndBlowfish",
  267. gnu.crypto.jce.cipher.PBES2.HMacTiger.Blowfish.class.getName());
  268. put("Cipher.PBEWithHMacTigerAndCast5",
  269. gnu.crypto.jce.cipher.PBES2.HMacTiger.Cast5.class.getName());
  270. put("Cipher.PBEWithHMacTigerAndDES",
  271. gnu.crypto.jce.cipher.PBES2.HMacTiger.DES.class.getName());
  272. put("Cipher.PBEWithHMacTigerAndKhazad",
  273. gnu.crypto.jce.cipher.PBES2.HMacTiger.Khazad.class.getName());
  274. put("Cipher.PBEWithHMacTigerAndSerpent",
  275. gnu.crypto.jce.cipher.PBES2.HMacTiger.Serpent.class.getName());
  276. put("Cipher.PBEWithHMacTigerAndSquare",
  277. gnu.crypto.jce.cipher.PBES2.HMacTiger.Square.class.getName());
  278. put("Cipher.PBEWithHMacTigerAndTripleDES",
  279. gnu.crypto.jce.cipher.PBES2.HMacTiger.TripleDES.class.getName());
  280. put("Cipher.PBEWithHMacTigerAndTwofish",
  281. gnu.crypto.jce.cipher.PBES2.HMacTiger.Twofish.class.getName());
  282. put("Cipher.PBEWithHMacWhirlpoolAndAES",
  283. gnu.crypto.jce.cipher.PBES2.HMacWhirlpool.AES.class.getName());
  284. put("Cipher.PBEWithHMacWhirlpoolAndAnubis",
  285. gnu.crypto.jce.cipher.PBES2.HMacWhirlpool.Anubis.class.getName());
  286. put("Cipher.PBEWithHMacWhirlpoolAndBlowfish",
  287. gnu.crypto.jce.cipher.PBES2.HMacWhirlpool.Blowfish.class.getName());
  288. put("Cipher.PBEWithHMacWhirlpoolAndCast5",
  289. gnu.crypto.jce.cipher.PBES2.HMacWhirlpool.Cast5.class.getName());
  290. put("Cipher.PBEWithHMacWhirlpoolAndDES",
  291. gnu.crypto.jce.cipher.PBES2.HMacWhirlpool.DES.class.getName());
  292. put("Cipher.PBEWithHMacWhirlpoolAndKhazad",
  293. gnu.crypto.jce.cipher.PBES2.HMacWhirlpool.Khazad.class.getName());
  294. put("Cipher.PBEWithHMacWhirlpoolAndSerpent",
  295. gnu.crypto.jce.cipher.PBES2.HMacWhirlpool.Serpent.class.getName());
  296. put("Cipher.PBEWithHMacWhirlpoolAndSquare",
  297. gnu.crypto.jce.cipher.PBES2.HMacWhirlpool.Square.class.getName());
  298. put("Cipher.PBEWithHMacWhirlpoolAndTripleDES",
  299. gnu.crypto.jce.cipher.PBES2.HMacWhirlpool.TripleDES.class.getName());
  300. put("Cipher.PBEWithHMacWhirlpoolAndTwofish",
  301. gnu.crypto.jce.cipher.PBES2.HMacWhirlpool.Twofish.class.getName());
  302. // SecretKeyFactory interface to PBKDF2.
  303. put("SecretKeyFactory.PBKDF2WithHMacHaval",
  304. gnu.crypto.jce.PBKDF2SecretKeyFactory.HMacHaval.class.getName());
  305. put("SecretKeyFactory.PBKDF2WithHMacMD2",
  306. gnu.crypto.jce.PBKDF2SecretKeyFactory.HMacMD2.class.getName());
  307. put("SecretKeyFactory.PBKDF2WithHMacMD4",
  308. gnu.crypto.jce.PBKDF2SecretKeyFactory.HMacMD4.class.getName());
  309. put("SecretKeyFactory.PBKDF2WithHMacMD5",
  310. gnu.crypto.jce.PBKDF2SecretKeyFactory.HMacMD5.class.getName());
  311. put("SecretKeyFactory.PBKDF2WithHMacSHA1",
  312. gnu.crypto.jce.PBKDF2SecretKeyFactory.HMacSHA1.class.getName());
  313. put("SecretKeyFactory.PBKDF2WithHMacSHA256",
  314. gnu.crypto.jce.PBKDF2SecretKeyFactory.HMacSHA256.class.getName());
  315. put("SecretKeyFactory.PBKDF2WithHMacSHA384",
  316. gnu.crypto.jce.PBKDF2SecretKeyFactory.HMacSHA384.class.getName());
  317. put("SecretKeyFactory.PBKDF2WithHMacSHA512",
  318. gnu.crypto.jce.PBKDF2SecretKeyFactory.HMacSHA512.class.getName());
  319. put("SecretKeyFactory.PBKDF2WithHMacTiger",
  320. gnu.crypto.jce.PBKDF2SecretKeyFactory.HMacTiger.class.getName());
  321. put("SecretKeyFactory.PBKDF2WithHMacWhirlpool",
  322. gnu.crypto.jce.PBKDF2SecretKeyFactory.HMacWhirlpool.class.getName());
  323. // Simple SecretKeyFactory implementations.
  324. put ("SecretKeyFactory.Anubis", gnu.crypto.jce.key.AnubisSecretKeyFactoryImpl.class.getName());
  325. put ("SecretKeyFactory.Blowfish", gnu.crypto.jce.key.BlowfishSecretKeyFactoryImpl.class.getName());
  326. put ("SecretKeyFactory.Cast5", gnu.crypto.jce.key.Cast5SecretKeyFactoryImpl.class.getName());
  327. put ("SecretKeyFactory.DES", gnu.crypto.jce.key.DESSecretKeyFactoryImpl.class.getName());
  328. put ("SecretKeyFactory.Khazad", gnu.crypto.jce.key.KhazadSecretKeyFactoryImpl.class.getName());
  329. put ("SecretKeyFactory.Rijndael", gnu.crypto.jce.key.RijndaelSecretKeyFactoryImpl.class.getName());
  330. put ("SecretKeyFactory.Serpent", gnu.crypto.jce.key.SerpentSecretKeyFactoryImpl.class.getName());
  331. put ("SecretKeyFactory.Square", gnu.crypto.jce.key.SquareSecretKeyFactoryImpl.class.getName());
  332. put ("SecretKeyFactory.TripleDES", gnu.crypto.jce.key.DESedeSecretKeyFactoryImpl.class.getName());
  333. put ("Alg.Alias.SecretKeyFactory.AES", "Rijndael");
  334. put ("Alg.Alias.SecretKeyFactory.DESede", "TripleDES");
  335. put ("Alg.Alias.SecretKeyFactory.3-DES", "TripleDES");
  336. put ("Alg.Alias.SecretKeyFactory.3DES", "TripleDES");
  337. put("AlgorithmParameters.BlockCipherParameters",
  338. gnu.crypto.jce.params.BlockCipherParameters.class.getName());
  339. // MAC
  340. put("Mac.HMAC-MD2", gnu.crypto.jce.mac.HMacMD2Spi.class.getName());
  341. put("Mac.HMAC-MD4", gnu.crypto.jce.mac.HMacMD4Spi.class.getName());
  342. put("Mac.HMAC-MD5", gnu.crypto.jce.mac.HMacMD5Spi.class.getName());
  343. put("Mac.HMAC-RIPEMD128", gnu.crypto.jce.mac.HMacRipeMD128Spi.class.getName());
  344. put("Mac.HMAC-RIPEMD160", gnu.crypto.jce.mac.HMacRipeMD160Spi.class.getName());
  345. put("Mac.HMAC-SHA160", gnu.crypto.jce.mac.HMacSHA160Spi.class.getName());
  346. put("Mac.HMAC-SHA256", gnu.crypto.jce.mac.HMacSHA256Spi.class.getName());
  347. put("Mac.HMAC-SHA384", gnu.crypto.jce.mac.HMacSHA384Spi.class.getName());
  348. put("Mac.HMAC-SHA512", gnu.crypto.jce.mac.HMacSHA512Spi.class.getName());
  349. put("Mac.HMAC-TIGER", gnu.crypto.jce.mac.HMacTigerSpi.class.getName());
  350. put("Mac.HMAC-HAVAL", gnu.crypto.jce.mac.HMacHavalSpi.class.getName());
  351. put("Mac.HMAC-WHIRLPOOL", gnu.crypto.jce.mac.HMacWhirlpoolSpi.class.getName());
  352. put("Mac.TMMH16", gnu.crypto.jce.mac.TMMH16Spi.class.getName());
  353. put("Mac.UHASH32", gnu.crypto.jce.mac.UHash32Spi.class.getName());
  354. put("Mac.UMAC32", gnu.crypto.jce.mac.UMac32Spi.class.getName());
  355. put("Mac.OMAC-ANUBIS", gnu.crypto.jce.mac.OMacAnubisImpl.class.getName());
  356. put("Mac.OMAC-BLOWFISH", gnu.crypto.jce.mac.OMacBlowfishImpl.class.getName());
  357. put("Mac.OMAC-CAST5", gnu.crypto.jce.mac.OMacCast5Impl.class.getName());
  358. put("Mac.OMAC-DES", gnu.crypto.jce.mac.OMacDESImpl.class.getName());
  359. put("Mac.OMAC-KHAZAD", gnu.crypto.jce.mac.OMacKhazadImpl.class.getName());
  360. put("Mac.OMAC-RIJNDAEL", gnu.crypto.jce.mac.OMacRijndaelImpl.class.getName());
  361. put("Mac.OMAC-SERPENT", gnu.crypto.jce.mac.OMacSerpentImpl.class.getName());
  362. put("Mac.OMAC-SQUARE", gnu.crypto.jce.mac.OMacSquareImpl.class.getName());
  363. put("Mac.OMAC-TRIPLEDES", gnu.crypto.jce.mac.OMacTripleDESImpl.class.getName());
  364. put("Mac.OMAC-TWOFISH", gnu.crypto.jce.mac.OMacTwofishImpl.class.getName());
  365. // Aliases
  366. put("Alg.Alias.AlgorithmParameters.AES", "BlockCipherParameters");
  367. put("Alg.Alias.AlgorithmParameters.BLOWFISH", "BlockCipherParameters");
  368. put("Alg.Alias.AlgorithmParameters.ANUBIS", "BlockCipherParameters");
  369. put("Alg.Alias.AlgorithmParameters.KHAZAD", "BlockCipherParameters");
  370. put("Alg.Alias.AlgorithmParameters.NULL", "BlockCipherParameters");
  371. put("Alg.Alias.AlgorithmParameters.RIJNDAEL", "BlockCipherParameters");
  372. put("Alg.Alias.AlgorithmParameters.SERPENT", "BlockCipherParameters");
  373. put("Alg.Alias.AlgorithmParameters.SQUARE", "BlockCipherParameters");
  374. put("Alg.Alias.AlgorithmParameters.TWOFISH", "BlockCipherParameters");
  375. put("Alg.Alias.Cipher.RC4", "ARCFOUR");
  376. put("Alg.Alias.Cipher.3-DES", "TRIPLEDES");
  377. put("Alg.Alias.Cipher.3DES", "TRIPLEDES");
  378. put("Alg.Alias.Cipher.DES-EDE", "TRIPLEDES");
  379. put("Alg.Alias.Cipher.DESede", "TRIPLEDES");
  380. put("Alg.Alias.Cipher.CAST128", "CAST5");
  381. put("Alg.Alias.Cipher.CAST-128", "CAST5");
  382. put("Alg.Alias.Mac.HMAC-SHS", "HMAC-SHA160");
  383. put("Alg.Alias.Mac.HMAC-SHA", "HMAC-SHA160");
  384. put("Alg.Alias.Mac.HMAC-SHA1", "HMAC-SHA160");
  385. put("Alg.Alias.Mac.HMAC-SHA-160", "HMAC-SHA160");
  386. put("Alg.Alias.Mac.HMAC-SHA-256", "HMAC-SHA256");
  387. put("Alg.Alias.Mac.HMAC-SHA-384", "HMAC-SHA384");
  388. put("Alg.Alias.Mac.HMAC-SHA-512", "HMAC-SHA512");
  389. put("Alg.Alias.Mac.HMAC-RIPEMD-160", "HMAC-RIPEMD160");
  390. put("Alg.Alias.Mac.HMAC-RIPEMD-128", "HMAC-RIPEMD128");
  391. put("Alg.Alias.Mac.OMAC-AES", "OMAC-RIJNDAEL");
  392. put("Alg.Alias.Mac.OMAC-3DES", "OMAC-3DES");
  393. put("Alg.Alias.Mac.HmacMD4", "HMAC-MD4");
  394. put("Alg.Alias.Mac.HmacMD5", "HMAC-MD5");
  395. put("Alg.Alias.Mac.HmacSHA-1", "HMAC-SHA-1");
  396. put("Alg.Alias.Mac.HmacSHA1", "HMAC-SHA1");
  397. put("Alg.Alias.Mac.HmacSHA-160", "HMAC-SHA-160");
  398. put("Alg.Alias.Mac.HmacSHA160", "HMAC-SHA-160");
  399. put("Alg.Alias.Mac.HmacSHA-256", "HMAC-SHA-256");
  400. put("Alg.Alias.Mac.HmacSHA256", "HMAC-SHA-256");
  401. put("Alg.Alias.Mac.HmacSHA-384", "HMAC-SHA-384");
  402. put("Alg.Alias.Mac.HmacSHA384", "HMAC-SHA-384");
  403. put("Alg.Alias.Mac.HmacSHA-512", "HMAC-SHA-512");
  404. put("Alg.Alias.Mac.HmacSHA512", "HMAC-SHA-512");
  405. put("Alg.Alias.Mac.HmacRIPEMD128", "HMAC-RIPEMD128");
  406. put("Alg.Alias.Mac.HmacRIPEMD-128", "HMAC-RIPEMD128");
  407. put("Alg.Alias.Mac.HmacRIPEMD160", "HMAC-RIPEMD160");
  408. put("Alg.Alias.Mac.HmacRIPEMD-160", "HMAC-RIPEMD160");
  409. put("Alg.Alias.Mac.HmacTiger", "HMAC-TIGER");
  410. put("Alg.Alias.Mac.HmacHaval", "HMAC-HAVAL");
  411. put("Alg.Alias.Mac.HmacWhirlpool", "HMAC-WHIRLPOOL");
  412. return null;
  413. }
  414. }
  415. );
  416. }
  417. // Class methods
  418. // -------------------------------------------------------------------------
  419. /**
  420. * <p>Returns a {@link Set} of names of symmetric key block cipher algorithms
  421. * available from this {@link Provider}.</p>
  422. *
  423. * @return a {@link Set} of cipher names (Strings).
  424. */
  425. public static final Set getCipherNames() {
  426. HashSet s = new HashSet();
  427. s.addAll(CipherFactory.getNames());
  428. s.add(Registry.ARCFOUR_PRNG);
  429. return s;
  430. }
  431. /**
  432. * <p>Returns a {@link Set} of names of MAC algorithms available from
  433. * this {@link Provider}.</p>
  434. *
  435. * @return a {@link Set} of MAC names (Strings).
  436. */
  437. public static final Set getMacNames() {
  438. return MacFactory.getNames();
  439. }
  440. // Instance methods
  441. // -------------------------------------------------------------------------
  442. }