- All Implemented Interfaces:
Provider
RSA 加密解密算法
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
RSAProvider
public RSAProvider()
-
Method Details
-
encrypt
public byte[] encrypt(String key,
byte[] content)
加密
- Specified by:
encrypt in interface Provider
- Parameters:
key - 密钥
content - 需要加密的内容
- Returns:
- 加密结果
-
decrypt
public byte[] decrypt(String key,
byte[] content)
解密
- Specified by:
decrypt in interface Provider
- Parameters:
key - 密钥
content - 需要解密的内容
- Returns:
- 解密结果