13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package com.oracle.security.ucrypto;
27
28 import java.util.HashMap;
29
30 /**
31 * Enum for representing the ucrypto mechanisms.
32 *
33 * @since 1.9
34 */
35 // Check /usr/include/libsoftcrypto.h for updates
36 public enum UcryptoMech {
37
38 CRYPTO_AES_ECB(1, new ServiceDesc[]
39 { sd("Cipher", "AES/ECB/NoPadding", "com.oracle.security.ucrypto.NativeCipher$AesEcbNoPadding"),
40 sd("Cipher", "AES/ECB/PKCS5Padding", "com.oracle.security.ucrypto.NativeCipherWithJavaPadding$AesEcbPKCS5",
41 "AES"),
42 sd("Cipher", "AES_128/ECB/NoPadding", "com.oracle.security.ucrypto.NativeCipher$Aes128EcbNoPadding",
43 "2.16.840.1.101.3.4.1.1", "OID.2.16.840.1.101.3.4.1.1"),
44 sd("Cipher", "AES_192/ECB/NoPadding", "com.oracle.security.ucrypto.NativeCipher$Aes192EcbNoPadding",
45 "2.16.840.1.101.3.4.1.21", "OID.2.16.840.1.101.3.4.1.21"),
46 sd("Cipher", "AES_256/ECB/NoPadding", "com.oracle.security.ucrypto.NativeCipher$Aes256EcbNoPadding",
47 "2.16.840.1.101.3.4.1.41", "OID.2.16.840.1.101.3.4.1.41")
48 }),
49 CRYPTO_AES_CBC(2, new ServiceDesc[]
50 { sd("Cipher", "AES/CBC/NoPadding", "com.oracle.security.ucrypto.NativeCipher$AesCbcNoPadding"),
51 sd("Cipher", "AES/CBC/PKCS5Padding", "com.oracle.security.ucrypto.NativeCipherWithJavaPadding$AesCbcPKCS5"),
52 sd("Cipher", "AES_128/CBC/NoPadding", "com.oracle.security.ucrypto.NativeCipher$Aes128CbcNoPadding",
53 "2.16.840.1.101.3.4.1.2", "OID.2.16.840.1.101.3.4.1.2"),
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package com.oracle.security.ucrypto;
27
28 import java.util.HashMap;
29
30 /**
31 * Enum for representing the ucrypto mechanisms.
32 *
33 * @since 9
34 */
35 // Check /usr/include/libsoftcrypto.h for updates
36 public enum UcryptoMech {
37
38 CRYPTO_AES_ECB(1, new ServiceDesc[]
39 { sd("Cipher", "AES/ECB/NoPadding", "com.oracle.security.ucrypto.NativeCipher$AesEcbNoPadding"),
40 sd("Cipher", "AES/ECB/PKCS5Padding", "com.oracle.security.ucrypto.NativeCipherWithJavaPadding$AesEcbPKCS5",
41 "AES"),
42 sd("Cipher", "AES_128/ECB/NoPadding", "com.oracle.security.ucrypto.NativeCipher$Aes128EcbNoPadding",
43 "2.16.840.1.101.3.4.1.1", "OID.2.16.840.1.101.3.4.1.1"),
44 sd("Cipher", "AES_192/ECB/NoPadding", "com.oracle.security.ucrypto.NativeCipher$Aes192EcbNoPadding",
45 "2.16.840.1.101.3.4.1.21", "OID.2.16.840.1.101.3.4.1.21"),
46 sd("Cipher", "AES_256/ECB/NoPadding", "com.oracle.security.ucrypto.NativeCipher$Aes256EcbNoPadding",
47 "2.16.840.1.101.3.4.1.41", "OID.2.16.840.1.101.3.4.1.41")
48 }),
49 CRYPTO_AES_CBC(2, new ServiceDesc[]
50 { sd("Cipher", "AES/CBC/NoPadding", "com.oracle.security.ucrypto.NativeCipher$AesCbcNoPadding"),
51 sd("Cipher", "AES/CBC/PKCS5Padding", "com.oracle.security.ucrypto.NativeCipherWithJavaPadding$AesCbcPKCS5"),
52 sd("Cipher", "AES_128/CBC/NoPadding", "com.oracle.security.ucrypto.NativeCipher$Aes128CbcNoPadding",
53 "2.16.840.1.101.3.4.1.2", "OID.2.16.840.1.101.3.4.1.2"),
|