| Constructor and Description |
|---|
Ciphers(Cipher cipher)
构造
|
Ciphers(String algorithm)
构造
|
| Modifier and Type | Method and Description |
|---|---|
Cipher |
getCipher()
获取被包装的
Cipher |
AlgorithmParameterSpec |
getParams()
获取
AlgorithmParameterSpec
在某些算法中,需要特别的参数,例如在ECIES中,此处为IESParameterSpec |
Ciphers |
initMode(int mode,
Key key)
初始化
Cipher为加密或者解密模式 |
Ciphers |
setParams(AlgorithmParameterSpec params)
设置
AlgorithmParameterSpec,通常用于加盐或偏移向量 |
Ciphers |
setRandom(SecureRandom random)
设置随机数生成器,可自定义随机数种子
|
public Ciphers(String algorithm)
algorithm - 算法名称public AlgorithmParameterSpec getParams()
AlgorithmParameterSpec
在某些算法中,需要特别的参数,例如在ECIES中,此处为IESParameterSpecAlgorithmParameterSpecpublic Ciphers setParams(AlgorithmParameterSpec params)
AlgorithmParameterSpec,通常用于加盐或偏移向量params - AlgorithmParameterSpecpublic Ciphers setRandom(SecureRandom random)
random - 随机数生成器,可自定义随机数种子public Ciphers initMode(int mode, Key key) throws InvalidKeyException, InvalidAlgorithmParameterException
Cipher为加密或者解密模式mode - 模式,见Cipher.ENCRYPT_MODE 或 Cipher.DECRYPT_MODEkey - 密钥InvalidKeyException - 无效keyInvalidAlgorithmParameterException - 无效算法Copyright © 2021. All rights reserved.