mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
由于对于ASCII的编码解码有缺陷,且这种BCD实现并不规范,因此BCD标记为弃用
This commit is contained in:
@@ -103,7 +103,9 @@ public interface AsymmetricDecryptor {
|
||||
* @param charset 加密前编码
|
||||
* @return 解密后的密文
|
||||
* @since 4.1.0
|
||||
* @deprecated 由于对于ASCII的编码解码有缺陷,且这种BCD实现并不规范,因此会在6.0.0中移除
|
||||
*/
|
||||
@Deprecated
|
||||
default byte[] decryptFromBcd(String data, KeyType keyType, Charset charset) {
|
||||
Assert.notNull(data, "Bcd string must be not null!");
|
||||
final byte[] dataBytes = BCD.ascToBcd(StrUtil.bytes(data, charset));
|
||||
@@ -118,7 +120,9 @@ public interface AsymmetricDecryptor {
|
||||
* @param charset 加密前编码
|
||||
* @return 解密后的密文
|
||||
* @since 4.5.2
|
||||
* @deprecated 由于对于ASCII的编码解码有缺陷,且这种BCD实现并不规范,因此会在6.0.0中移除
|
||||
*/
|
||||
@Deprecated
|
||||
default String decryptStrFromBcd(String data, KeyType keyType, Charset charset) {
|
||||
return StrUtil.str(decryptFromBcd(data, keyType, charset), charset);
|
||||
}
|
||||
@@ -130,7 +134,9 @@ public interface AsymmetricDecryptor {
|
||||
* @param keyType 密钥类型
|
||||
* @return 解密后的密文
|
||||
* @since 4.5.2
|
||||
* @deprecated 由于对于ASCII的编码解码有缺陷,且这种BCD实现并不规范,因此会在6.0.0中移除
|
||||
*/
|
||||
@Deprecated
|
||||
default String decryptStrFromBcd(String data, KeyType keyType) {
|
||||
return decryptStrFromBcd(data, keyType, CharsetUtil.CHARSET_UTF_8);
|
||||
}
|
||||
|
@@ -185,7 +185,9 @@ public interface AsymmetricEncryptor {
|
||||
* @param keyType 密钥类型
|
||||
* @return 加密后的密文
|
||||
* @since 4.1.0
|
||||
* @deprecated 由于对于ASCII的编码解码有缺陷,且这种BCD实现并不规范,因此会在6.0.0中移除
|
||||
*/
|
||||
@Deprecated
|
||||
default String encryptBcd(String data, KeyType keyType) {
|
||||
return encryptBcd(data, keyType, CharsetUtil.CHARSET_UTF_8);
|
||||
}
|
||||
@@ -198,7 +200,9 @@ public interface AsymmetricEncryptor {
|
||||
* @param charset 加密前编码
|
||||
* @return 加密后的密文
|
||||
* @since 4.1.0
|
||||
* @deprecated 由于对于ASCII的编码解码有缺陷,且这种BCD实现并不规范,因此会在6.0.0中移除
|
||||
*/
|
||||
@Deprecated
|
||||
default String encryptBcd(String data, KeyType keyType, Charset charset) {
|
||||
return BCD.bcdToStr(encrypt(data, charset, keyType));
|
||||
}
|
||||
|
Reference in New Issue
Block a user