类 CryptoUtils
- java.lang.Object
-
- com.baomidou.dynamic.datasource.toolkit.CryptoUtils
-
public class CryptoUtils extends Object
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 StringDEFAULT_PUBLIC_KEY_STRING
-
构造器概要
构造器 构造器 说明 CryptoUtils()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static Stringdecrypt(String cipherText)static Stringdecrypt(String publicKeyText, String cipherText)static Stringdecrypt(PublicKey publicKey, String cipherText)static Stringencrypt(byte[] keyBytes, String plainText)static Stringencrypt(String plainText)static Stringencrypt(String key, String plainText)static String[]genKeyPair(int keySize)static byte[][]genKeyPairBytes(int keySize)static PublicKeygetPublicKey(String publicKeyText)static PublicKeygetPublicKeyByPublicKeyFile(String publicKeyFile)static PublicKeygetPublicKeyByX509(String x509File)
-
-
-
方法详细资料
-
decrypt
public static String decrypt(String publicKeyText, String cipherText) throws Exception
- 抛出:
Exception
-
getPublicKeyByPublicKeyFile
public static PublicKey getPublicKeyByPublicKeyFile(String publicKeyFile)
-
decrypt
public static String decrypt(PublicKey publicKey, String cipherText) throws Exception
- 抛出:
Exception
-
encrypt
public static String encrypt(byte[] keyBytes, String plainText) throws Exception
- 抛出:
Exception
-
genKeyPairBytes
public static byte[][] genKeyPairBytes(int keySize)
-
genKeyPair
public static String[] genKeyPair(int keySize)
-
-