public class RSADigestUtils extends Object
Description: API to append RSA digest numbers
| 限定符和类型 | 类和说明 |
|---|---|
class |
RSADigestUtils.KeyPairInfo |
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
ENCRYPT_TYPE |
| 构造器和说明 |
|---|
RSADigestUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
decipher(String contentBase64,
Key key,
int segmentSize) |
static String |
decipher(String contentBase64,
String privateKeyBase64) |
static String |
decipher(String contentBase64,
String privateKeyBase64,
int segmentSize) |
static String |
encipher(String ciphertext,
Key key,
int segmentSize) |
static String |
encipher(String content,
String publicKeyBase64) |
static String |
encipher(String content,
String publicKeyBase64,
int segmentSize) |
RSADigestUtils.KeyPairInfo |
getKeyPair()
key pair(key size=1024)
|
RSADigestUtils.KeyPairInfo |
getKeyPair(int keySize) |
static PrivateKey |
getPrivateKey(String privateKeyBase64) |
static PublicKey |
getPublicKey(String publicKeyBase64) |
public RSADigestUtils.KeyPairInfo getKeyPair() throws NoSuchAlgorithmException
NoSuchAlgorithmException - exceptionpublic RSADigestUtils.KeyPairInfo getKeyPair(int keySize) throws NoSuchAlgorithmException
keySize - keySizeNoSuchAlgorithmException - exceptionpublic static PublicKey getPublicKey(String publicKeyBase64) throws InvalidKeySpecException, NoSuchAlgorithmException
publicKeyBase64 - public keyInvalidKeySpecException - exceptionNoSuchAlgorithmException - exceptionpublic static PrivateKey getPrivateKey(String privateKeyBase64) throws NoSuchAlgorithmException, InvalidKeySpecException
privateKeyBase64 - privateKeyNoSuchAlgorithmException - exceptionInvalidKeySpecException - exceptionpublic static String encipher(String content, String publicKeyBase64)
content - contentpublicKeyBase64 - publicKeyBase64public static String encipher(String content, String publicKeyBase64, int segmentSize)
content - contentpublicKeyBase64 - publicKeyBase64segmentSize - segmentSizepublic static String encipher(String ciphertext, Key key, int segmentSize)
ciphertext - ciphertextkey - keysegmentSize - segmentSizepublic static String decipher(String contentBase64, String privateKeyBase64) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, IOException
contentBase64 - contentprivateKeyBase64 - private keyNoSuchPaddingException - exceptionNoSuchAlgorithmException - exceptionInvalidKeySpecException - exceptionInvalidKeyException - exceptionIllegalBlockSizeException - exceptionBadPaddingException - exceptionIOException - exceptionpublic static String decipher(String contentBase64, String privateKeyBase64, int segmentSize) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException, IllegalBlockSizeException, BadPaddingException, IOException
contentBase64 - baseprivateKeyBase64 - privateKeysegmentSize - sizeNoSuchPaddingException - exceptionNoSuchAlgorithmException - exceptionInvalidKeyException - exceptionInvalidKeySpecException - exceptionIllegalBlockSizeException - exceptionBadPaddingException - exceptionIOException - exceptionpublic static String decipher(String contentBase64, Key key, int segmentSize) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, IOException
contentBase64 - contentkey - keysegmentSize - sizeNoSuchAlgorithmException - exceptionNoSuchPaddingException - exceptionInvalidKeyException - exceptionIllegalBlockSizeException - exceptionBadPaddingException - exceptionIOException - exceptionCopyright © 2021. All rights reserved.