public class Pkcs8KeyOperator extends Object implements KeyOperator
| 构造器和说明 |
|---|
Pkcs8KeyOperator() |
| 限定符和类型 | 方法和说明 |
|---|---|
Keypair |
generate(KeyTypeEnum type)
Generate asymmetric key pair by algId
|
Keypair |
load(byte[] keyBytes,
String password)
Load asymmetric key pair from keyBytes.
|
Keypair |
load(String path,
String password)
Load asymmetric key pair from PKCS8 file.
|
Keypair |
loadFromPrivkey(byte[] privkeyEncoded) |
Keypair |
loadFromPubkey(byte[] pubkeyBytes) |
Keypair |
loadPubkey(byte[] pubkeyBytes)
Load public key from keyBytes. the keyBytes is PKCS8 format.
|
Keypair |
loadPubkey(String path)
Load public key from PKCS8 file.
|
boolean |
save(Keypair key,
String path,
String password)
Save asymmetric key pair to PKCS8 file.
|
public Keypair generate(KeyTypeEnum type)
generate 在接口中 KeyOperatortype - public Keypair loadFromPrivkey(byte[] privkeyEncoded)
loadFromPrivkey 在接口中 KeyOperatorprivkeyEncoded - public Keypair load(String path, String password)
load 在接口中 KeyOperatorpath - the passphrase of key file.password - the passphrase of key file. If password is null, the key pair is plaintext.public Keypair load(byte[] keyBytes, String password)
load 在接口中 KeyOperatorkeyBytes - the passphrase of key file.password - the passphrase of key file. If password is null, the key pair is plaintext.public Keypair loadPubkey(String path)
loadPubkey 在接口中 KeyOperatorpath - the file path of key.public Keypair loadPubkey(byte[] pubkeyBytes)
loadPubkey 在接口中 KeyOperatorpubkeyBytes - public Keypair loadFromPubkey(byte[] pubkeyBytes)
loadFromPubkey 在接口中 KeyOperatorpubkeyBytes - encoded public key.public boolean save(Keypair key, String path, String password)
save 在接口中 KeyOperatorkey - key pairpath - the file pathpassword - the passphrase of key.If password is null, the key pair will by saved by none password.Copyright © 2022. All rights reserved.