1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.juddi.cryptor;
17
18 import java.security.InvalidAlgorithmParameterException;
19 import java.security.InvalidKeyException;
20 import java.security.NoSuchAlgorithmException;
21
22 import javax.crypto.BadPaddingException;
23 import javax.crypto.IllegalBlockSizeException;
24 import javax.crypto.NoSuchPaddingException;
25
26 /***
27 * @author Anou Manavalan
28 */
29 public interface Cryptor
30 {
31 /***
32 * Encrypt the string
33 */
34 byte[] encrypt(byte[] bytes)
35 throws NoSuchPaddingException,
36 NoSuchAlgorithmException,
37 InvalidAlgorithmParameterException,
38 InvalidKeyException,
39 IllegalBlockSizeException,
40 BadPaddingException;
41
42 String encrypt(String str)
43 throws NoSuchPaddingException,
44 NoSuchAlgorithmException,
45 InvalidAlgorithmParameterException,
46 InvalidKeyException,
47 IllegalBlockSizeException,
48 BadPaddingException;
49
50 /***
51 * Decrypt the string
52 */
53 byte[] decrypt(byte[] bytes)
54 throws NoSuchPaddingException,
55 NoSuchAlgorithmException,
56 InvalidAlgorithmParameterException,
57 InvalidKeyException,
58 IllegalBlockSizeException,
59 BadPaddingException;
60
61 String decrypt(String str)
62 throws NoSuchPaddingException,
63 NoSuchAlgorithmException,
64 InvalidAlgorithmParameterException,
65 InvalidKeyException,
66 IllegalBlockSizeException,
67 BadPaddingException;
68 }