public class KeySaving extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
ENCRYPTED_KEY_FILE |
static String |
PRIVATE_KEY_FILE |
static String |
PUBLIC_KEY_FILE |
static String |
TOKEN_FILE |
| 构造器和说明 |
|---|
KeySaving() |
| 限定符和类型 | 方法和说明 |
|---|---|
static SecretKey |
decryptKey(byte[] encryptedKey,
PrivateKey privateKey) |
static byte[] |
encryptKey(SecretKey secretKey,
PublicKey publicKey) |
static SecretKey |
generateSymmetricKey() |
static byte[] |
loadKeyFromFile(String fileName) |
static void |
main(String[] args) |
static void |
saveKeyToFile(byte[] keyData,
String fileName) |
public static byte[] encryptKey(SecretKey secretKey, PublicKey publicKey) throws Exception
Exceptionpublic static SecretKey decryptKey(byte[] encryptedKey, PrivateKey privateKey) throws Exception
Exceptionpublic static void saveKeyToFile(byte[] keyData,
String fileName)
throws Exception
ExceptionCopyright © 2024. All rights reserved.