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, initKeyToStringpublic byte[] initKey()
throws Exception
CodecUtils.CodecHelperinitKey in class CodecUtils.CodecHelperException - if an error occurs.public Key toKey(byte[] key) throws Exception
CodecUtils.CodecHelpertoKey in class CodecUtils.CodecHelperkey - 二进制密钥Exception - if an error occurs.public byte[] encrypt(byte[] data,
byte[] key)
throws Exception
CodecUtils.CodecHelperencrypt in class CodecUtils.CodecHelperdata - 待加密数据key - 密钥Exception - if an error occurs.public byte[] encrypt(byte[] data,
byte[] key,
byte[] salt)
throws Exception
Exceptionpublic String encrypt(String data, String key, String salt) throws Exception
Exceptionpublic byte[] decrypt(byte[] data,
byte[] key)
throws Exception
CodecUtils.CodecHelperdecrypt in class CodecUtils.CodecHelperdata - 待解密数据key - 密钥Exception - if an error occurs.public byte[] decrypt(byte[] data,
byte[] key,
byte[] salt)
throws Exception
ExceptionCopyright © 2022. All rights reserved.