Package org.aoju.bus.crypto
Class Ciphers
java.lang.Object
org.aoju.bus.crypto.Ciphers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription获取AlgorithmParameterSpec在某些算法中,需要特别的参数,例如在ECIES中,此处为IESParameterSpecgetRaw()获取被包装的Cipher初始化Cipher为加密或者解密模式setParams(AlgorithmParameterSpec params) 设置AlgorithmParameterSpec,通常用于加盐或偏移向量setRandom(SecureRandom random) 设置随机数生成器,可自定义随机数种子
-
Constructor Details
-
Ciphers
-
Ciphers
-
-
Method Details
-
getParams
获取AlgorithmParameterSpec在某些算法中,需要特别的参数,例如在ECIES中,此处为IESParameterSpec- Returns:
AlgorithmParameterSpec
-
setParams
设置AlgorithmParameterSpec,通常用于加盐或偏移向量- Parameters:
params-AlgorithmParameterSpec- Returns:
- this
-
setRandom
设置随机数生成器,可自定义随机数种子- Parameters:
random- 随机数生成器,可自定义随机数种子- Returns:
- this
-
getRaw
-
initMode
public Ciphers initMode(int mode, Key key) throws InvalidKeyException, InvalidAlgorithmParameterException 初始化Cipher为加密或者解密模式- Parameters:
mode- 模式,见Cipher.ENCRYPT_MODE或Cipher.DECRYPT_MODEkey- 密钥- Returns:
- this
- Throws:
InvalidKeyException- 无效keyInvalidAlgorithmParameterException- 无效算法
-