类 CryptoUtils
java.lang.Object
com.baomidou.dynamic.datasource.toolkit.CryptoUtils
Copyright 1999-2018 Alibaba Group Holding Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- 作者:
- alibaba
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static String加密算法RSAstatic String加密算法RSAstatic String加密算法RSAstatic String加密算法RSAstatic String加密算法RSAstatic String加密算法RSAstatic String[]genKeyPair(int keySize) 生成密钥对static byte[][]genKeyPairBytes(int keySize) 生成密钥对static PublicKeygetPublicKey(String publicKeyText) 加密算法RSAstatic PublicKeygetPublicKeyByPublicKeyFile(String publicKeyFile) 加密算法RSAstatic PublicKeygetPublicKeyByX509(String x509File) 加密算法RSA
-
字段详细资料
-
DEFAULT_PUBLIC_KEY_STRING
- 另请参阅:
-
-
构造器详细资料
-
CryptoUtils
public CryptoUtils()
-
-
方法详细资料
-
decrypt
加密算法RSA- 参数:
cipherText- 需要加密的字符串- 返回:
- 加密后的字符串
- 抛出:
Exception- 加密过程中的异常信息
-
decrypt
加密算法RSA- 参数:
publicKeyText- 公钥cipherText- 需要加密的字符串- 返回:
- 加密后的字符串
- 抛出:
Exception- 加密过程中的异常信息
-
getPublicKeyByX509
加密算法RSA- 参数:
x509File- 公钥文件- 返回:
- 加密后的字符串
-
getPublicKey
加密算法RSA- 参数:
publicKeyText- 公钥- 返回:
- 加密后的字符串
-
getPublicKeyByPublicKeyFile
加密算法RSA- 参数:
publicKeyFile- 公钥文件- 返回:
- 加密后的字符串
-
decrypt
加密算法RSA- 参数:
publicKey- 公钥cipherText- 需要加密的字符串- 返回:
- 加密后的字符串
- 抛出:
Exception- 加密过程中的异常信息
-
encrypt
加密算法RSA- 参数:
plainText- 需要加密的字符串- 返回:
- 加密后的字符串
- 抛出:
Exception- 加密过程中的异常信息
-
encrypt
加密算法RSA- 参数:
key- 加密的密钥plainText- 需要加密的字符串- 返回:
- 加密后的字符串
- 抛出:
Exception- 加密过程中的异常信息
-
encrypt
加密算法RSA- 参数:
keyBytes- 加密的密钥plainText- 需要加密的字符串- 返回:
- 加密后的字符串
- 抛出:
Exception- 加密过程中的异常信息
-
genKeyPairBytes
public static byte[][] genKeyPairBytes(int keySize) 生成密钥对- 参数:
keySize- 密钥对长度- 返回:
- 密钥对
-
genKeyPair
生成密钥对- 参数:
keySize- 密钥对长度- 返回:
- Base64编码后的密钥对
-