public static class CodecUtils.PBECodecHelper extends CodecUtils.CodecHelper
CIPHER_ALGORITHM, KEY_ALGORITHM, KEY_SIZE
Constructor and Description |
---|
PBECodecHelper(int iterationCount) |
Modifier and Type | Method and Description |
---|---|
byte[] |
decrypt(byte[] data,
byte[] key)
解密数据
|
byte[] |
decrypt(byte[] data,
byte[] key,
byte[] salt) |
String |
decrypt(String data,
String key,
String salt) |
byte[] |
encrypt(byte[] data,
byte[] key)
加密数据
|
byte[] |
encrypt(byte[] data,
byte[] key,
byte[] salt) |
String |
encrypt(String data,
String key,
String salt) |
byte[] |
initKey()
生成密钥
|
Key |
toKey(byte[] key)
转换密钥
|
decrypt, encrypt, getCipherInstance, initKeyToString
public byte[] initKey() throws Exception
CodecUtils.CodecHelper
initKey
in class CodecUtils.CodecHelper
Exception
- if an error occurs.public Key toKey(byte[] key) throws Exception
CodecUtils.CodecHelper
toKey
in class CodecUtils.CodecHelper
key
- 二进制密钥Exception
- if an error occurs.public byte[] encrypt(byte[] data, byte[] key) throws Exception
CodecUtils.CodecHelper
encrypt
in class CodecUtils.CodecHelper
data
- 待加密数据key
- 密钥Exception
- if an error occurs.public byte[] encrypt(byte[] data, byte[] key, byte[] salt) throws Exception
Exception
public String encrypt(String data, String key, String salt) throws Exception
Exception
public byte[] decrypt(byte[] data, byte[] key) throws Exception
CodecUtils.CodecHelper
decrypt
in class CodecUtils.CodecHelper
data
- 待解密数据key
- 密钥Exception
- if an error occurs.public byte[] decrypt(byte[] data, byte[] key, byte[] salt) throws Exception
Exception
Copyright © 2022. All rights reserved.