调整代码结构
This commit is contained in:
parent
b9ac3f1191
commit
aec514fa96
@ -54,7 +54,6 @@ public class AesUtil {
|
|||||||
// 9.加密
|
// 9.加密
|
||||||
return new String(Base64.encodeBase64(cipher.doFinal(contentByte)));
|
return new String(Base64.encodeBase64(cipher.doFinal(contentByte)));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
|
||||||
throw new AesEncodeException(e.getMessage(), e);
|
throw new AesEncodeException(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -88,7 +87,6 @@ public class AesUtil {
|
|||||||
// 8.解密
|
// 8.解密
|
||||||
return new String(cipher.doFinal(contentByte), "UTF-8");
|
return new String(cipher.doFinal(contentByte), "UTF-8");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
|
||||||
throw new AesDecodeException(e.getMessage(), e);
|
throw new AesDecodeException(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -105,7 +103,6 @@ public class AesUtil {
|
|||||||
byte[] encryptedBytes = aesCommonEncodeDetail(key, content, IV_STRING.getBytes(), PKCS_5);
|
byte[] encryptedBytes = aesCommonEncodeDetail(key, content, IV_STRING.getBytes(), PKCS_5);
|
||||||
return new String(Base64.encodeBase64(encryptedBytes), "UTF-8");
|
return new String(Base64.encodeBase64(encryptedBytes), "UTF-8");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
|
||||||
throw new AesEncodeException(e.getMessage(), e);
|
throw new AesEncodeException(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -131,7 +128,6 @@ public class AesUtil {
|
|||||||
cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivParameterSpec);
|
cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivParameterSpec);
|
||||||
return cipher.doFinal(byteContent);
|
return cipher.doFinal(byteContent);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
|
||||||
throw new AesEncodeException(e.getMessage(), e);
|
throw new AesEncodeException(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -151,7 +147,6 @@ public class AesUtil {
|
|||||||
byte[] result = aesCommonDecoderDetail(keyBytes, encryptedBytes, IV_STRING.getBytes(), PKCS_5);
|
byte[] result = aesCommonDecoderDetail(keyBytes, encryptedBytes, IV_STRING.getBytes(), PKCS_5);
|
||||||
return new String(result, "UTF-8");
|
return new String(result, "UTF-8");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
|
||||||
throw new AesDecodeException(e.getMessage(), e);
|
throw new AesDecodeException(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,7 +173,6 @@ public class AesUtil {
|
|||||||
cipher.init(Cipher.DECRYPT_MODE, secretKey, ivParameterSpec);
|
cipher.init(Cipher.DECRYPT_MODE, secretKey, ivParameterSpec);
|
||||||
return cipher.doFinal(encryptedBytes);
|
return cipher.doFinal(encryptedBytes);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
|
||||||
throw new AesDecodeException(e.getMessage(), e);
|
throw new AesDecodeException(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user