java.lang.Object
com.codingapi.springboot.framework.crypto.RSA
-
字段详细资料
-
KEY_ALGORITHM
- 另请参阅:
-
-
构造器详细资料
-
方法详细资料
-
generateKey
Generate key which contains a pair of privae and public key using 2048 bytes- 返回:
- key pair
- 抛出:
NoSuchAlgorithmException
-
getPrivateKey
public byte[] getPrivateKey() -
getPublicKey
public byte[] getPublicKey() -
encrypt
Encrypt a text using public key.- 参数:
text- The original unencrypted text- 返回:
- Encrypted text
- 抛出:
Exception
-
decrypt
Decrypt text using private key- 参数:
text- The encrypted text- 返回:
- The unencrypted text
- 抛出:
Exception
-