public abstract class BaseSymmetric extends Object implements SymmetricCrypto
Modifier and Type | Field and Description |
---|---|
protected CipherAlgorithm |
algorithm
加密算法
|
protected PaddingMode |
paddingMode
填充模式
|
protected SecretKey |
secretKey
密钥
|
protected WorkingMode |
workingMode
工作模式
|
Modifier | Constructor and Description |
---|---|
protected |
BaseSymmetric(CipherAlgorithm cipherAlgorithm,
WorkingMode workingMode,
PaddingMode paddingMode,
SecretKey secretKey) |
Modifier and Type | Method and Description |
---|---|
protected byte[] |
clearZeroPadding(byte[] bytes)
ZeroPadding 去除解密后的0位数
|
CipherAlgorithm |
getAlgorithm() |
protected Cipher |
getCipher()
获取 cipher
|
PaddingMode |
getPaddingMode() |
SecretKey |
getSecretKey() |
WorkingMode |
getWorkingMode() |
protected byte[] |
zeroPadding(byte[] bytes,
int blockSize)
ZeroPadding 0填充数据
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decrypt, decrypt, decryptAsString, decryptAsString, encrypt, encrypt, encryptAsString, encryptAsString, verify, verify
protected CipherAlgorithm algorithm
protected WorkingMode workingMode
protected PaddingMode paddingMode
protected SecretKey secretKey
protected BaseSymmetric(CipherAlgorithm cipherAlgorithm, WorkingMode workingMode, PaddingMode paddingMode, SecretKey secretKey)
protected Cipher getCipher()
protected byte[] clearZeroPadding(byte[] bytes)
bytes
- bytesprotected byte[] zeroPadding(byte[] bytes, int blockSize)
bytes
- 数据blockSize
- 块大小public CipherAlgorithm getAlgorithm()
public WorkingMode getWorkingMode()
public PaddingMode getPaddingMode()
public SecretKey getSecretKey()
Copyright © 2024. All rights reserved.