| 限定符和类型 | 类和说明 |
|---|---|
static class |
BCCipher.BCParameters
BouncyCastle库的
CipherParameters封装 |
Cipher.Parameters| 构造器和说明 |
|---|
BCCipher(org.bouncycastle.crypto.modes.AEADBlockCipher aeadBlockCipher)
构造
|
BCCipher(org.bouncycastle.crypto.BlockCipher blockCipher)
构造
|
BCCipher(org.bouncycastle.crypto.BufferedBlockCipher bufferedBlockCipher)
构造
|
BCCipher(org.bouncycastle.crypto.StreamCipher streamCipher)
构造
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
doFinal(byte[] out,
int outOff)
处理最后一块数据
当 Cipher.process(byte[], int, int, byte[], int)处理完数据后非完整块数据,此方法用于处理块中剩余的bytes如加密数据要求128bit,即16byes的整数,单数处理数据后为15bytes,此时根据padding方式不同,可填充剩余1byte为指定值(如填充0) 当对数据进行分段加密时,需要首先多次执行process方法,在最后一块数据处理完后执行此方法。 |
String |
getAlgorithmName()
获取算法名称
|
int |
getBlockSize()
获取块大小,当为Stream方式加密时返回0
|
int |
getOutputSize(int len)
根据输入长度,获取输出长度,输出长度与算法相关
输出长度只针对本次输入关联,即len长度的数据对应输出长度加doFinal的长度 |
Object |
getRaw() |
void |
init(CipherMode mode,
Cipher.Parameters parameters)
初始化模式和参数
|
int |
process(byte[] in,
int inOff,
int len,
byte[] out,
int outOff)
执行运算,可以是加密运算或解密运算
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprocessFinalpublic BCCipher(org.bouncycastle.crypto.BufferedBlockCipher bufferedBlockCipher)
bufferedBlockCipher - BufferedBlockCipherpublic BCCipher(org.bouncycastle.crypto.BlockCipher blockCipher)
blockCipher - BlockCipherpublic BCCipher(org.bouncycastle.crypto.modes.AEADBlockCipher aeadBlockCipher)
aeadBlockCipher - AEADBlockCipherpublic BCCipher(org.bouncycastle.crypto.StreamCipher streamCipher)
streamCipher - StreamCipherpublic String getAlgorithmName()
CiphergetAlgorithmName 在接口中 Cipherpublic int getBlockSize()
CiphergetBlockSize 在接口中 Cipherpublic void init(CipherMode mode, Cipher.Parameters parameters)
Cipherpublic int getOutputSize(int len)
CiphergetOutputSize 在接口中 Cipherlen - 输入长度public int process(byte[] in,
int inOff,
int len,
byte[] out,
int outOff)
Cipherpublic int doFinal(byte[] out,
int outOff)
CipherCipher.process(byte[], int, int, byte[], int)处理完数据后非完整块数据,此方法用于处理块中剩余的bytesCopyright © 2024. All rights reserved.