KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > juddi > cryptor > Cryptor


1 /*
2  * Copyright 2001-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.juddi.cryptor;
17
18 import java.security.InvalidAlgorithmParameterException JavaDoc;
19 import java.security.InvalidKeyException JavaDoc;
20 import java.security.NoSuchAlgorithmException JavaDoc;
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 JavaDoc,
37             InvalidAlgorithmParameterException JavaDoc,
38             InvalidKeyException JavaDoc,
39             IllegalBlockSizeException,
40             BadPaddingException;
41
42   String JavaDoc encrypt(String JavaDoc str)
43     throws NoSuchPaddingException,
44             NoSuchAlgorithmException JavaDoc,
45             InvalidAlgorithmParameterException JavaDoc,
46             InvalidKeyException JavaDoc,
47             IllegalBlockSizeException,
48             BadPaddingException;
49
50   /**
51    * Decrypt the string
52    */

53   byte[] decrypt(byte[] bytes)
54     throws NoSuchPaddingException,
55             NoSuchAlgorithmException JavaDoc,
56             InvalidAlgorithmParameterException JavaDoc,
57             InvalidKeyException JavaDoc,
58             IllegalBlockSizeException,
59             BadPaddingException;
60
61   String JavaDoc decrypt(String JavaDoc str)
62     throws NoSuchPaddingException,
63             NoSuchAlgorithmException JavaDoc,
64             InvalidAlgorithmParameterException JavaDoc,
65             InvalidKeyException JavaDoc,
66             IllegalBlockSizeException,
67             BadPaddingException;
68 }
Popular Tags