01: /*
02: * Copyright 2006-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.kuali.core.service;
17:
18: import java.security.GeneralSecurityException;
19:
20: /**
21: * Interface defining the methods a Kuali encryption service must implement.
22: *
23: *
24: */
25: public interface EncryptionService extends
26: edu.iu.uis.eden.security.EncryptionService {
27: /* string appended to an encrypted value by the frameworks for determine if a
28: value coming back from the ui is encrypted */
29: public static final String ENCRYPTION_POST_PREFIX = "(&^#&)";
30: public static final String HASH_POST_PREFIX = "(&^HSH#&)";
31:
32: /**
33: * Encrypts a value
34: *
35: * @param valueToHide - original value
36: * @return encrypted value
37: * @throws GeneralSecurityException
38: */
39: public String encrypt(Object valueToHide)
40: throws GeneralSecurityException;
41:
42: /**
43: * Decrypts a value
44: *
45: * @param ciphertext - encrypted value
46: * @return decrypted value
47: * @throws GeneralSecurityException
48: */
49: public String decrypt(String ciphertext)
50: throws GeneralSecurityException;
51:
52: /**
53: * Hashes a value (for one-way transformations)
54: *
55: * @param valueToHide - original value
56: * @return encrypted value
57: * @throws GeneralSecurityException
58: */
59: public String hash(Object valueToHide)
60: throws GeneralSecurityException;
61: }
|