This project has retired. For details please refer to its
Attic page.
AES128Cryptor xref
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.juddi.v3.client.cryptor;
18
19 import java.io.UnsupportedEncodingException;
20 import java.security.InvalidAlgorithmParameterException;
21 import java.security.InvalidKeyException;
22 import java.security.NoSuchAlgorithmException;
23 import java.security.spec.InvalidKeySpecException;
24
25 import javax.crypto.BadPaddingException;
26 import javax.crypto.IllegalBlockSizeException;
27 import javax.crypto.NoSuchPaddingException;
28
29
30
31
32
33
34 public class AES128Cryptor extends AESCryptorAbstract {
35
36
37
38
39 public AES128Cryptor()
40 throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException {
41 super();
42 }
43
44 @Override
45 protected String getKey() {
46
47 String key = CryptorFactory.loadKeyFromFile("AES128Cryptor");
48 if (key != null) {
49 return key;
50 } else {
51 return "72d93747ba0162f2f2985f5cb3e24b30";
52 }
53 }
54
55 @Override
56 public String encrypt(String str) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, UnsupportedEncodingException {
57 return super.encrypt(str);
58 }
59
60 @Override
61 public String decrypt(String str) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, UnsupportedEncodingException {
62 return super.decrypt(str);
63 }
64
65 @Override
66 public String newKey() {
67 return GEN(128);
68 }
69
70 }