?? aeskey.java
字號:
/**
* 使用AES算法生成sessionkey
*/
package src;
import java.security.*;
import javax.crypto.*;
public class AESKey{
private final static int BIT = 128;
private KeyGenerator keyGen;
private Key key;
/**
* @version 1.0
* default constructure
* initialize the keyGen
*/
public AESKey() {
try {
keyGen = KeyGenerator.getInstance("AES");
generateKey();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
}
private void generateKey() {
keyGen.init(BIT);
key = keyGen.generateKey();
}
public Key getKey(){
return key;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -