Java加密与文件传输EJB功能实现及测试
1. 加密模块
1.1 加密业务接口
EncryptionCommonBusiness 接口定义了一系列加密操作的通用方法,包括加密、解密、哈希处理和比较哈希值等功能。以下是接口代码:
package org.jboss.ejb3.examples.ch05.encryption;
public interface EncryptionCommonBusiness {
String encrypt(String input) throws IllegalArgumentException, EncryptionException;
String decrypt(String input) throws IllegalArgumentException, EncryptionException;
String hash(String input) throws IllegalArgumentException, EncryptionException;
boolean compare(String hash, String input) throws IllegalArgumentException, EncryptionException;
String getCiphersPassphrase();
String getMessageDigestAlgorithm();
}
具体方法说明如下:
| 方法名 | 功能描述 | 异常处理 |
超级会员免费看
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



