mirror of
https://gitee.com/willfree/min-dev-java.git
synced 2026-10-04 19:42:01 +08:00
使用mapDB持久化identity(50%)
This commit is contained in:
1 parent
9827414ac5
commit
f693a7a120
5 files changed
+194
-4
No files matched your search
@@ -20,6 +20,7 @@ import javax.crypto.BadPaddingException;
|
||||
import javax.crypto.IllegalBlockSizeException;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.security.InvalidAlgorithmParameterException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
@@ -43,10 +44,12 @@ public class Identity {
|
||||
private PublicKeyInterface Pubkey;
|
||||
private String Passwd;
|
||||
private Certificate Cert;
|
||||
private boolean IsDefault;
|
||||
|
||||
public Identity(String name, KeyParam keyParam,
|
||||
PrivateKeyInterface prikey, byte[] prikeyRawByte,
|
||||
PublicKeyInterface pubkey, String passwd, Certificate cert) {
|
||||
PublicKeyInterface pubkey, String passwd, Certificate cert,
|
||||
boolean isDefault) {
|
||||
Name = name;
|
||||
KeyParam = keyParam;
|
||||
Prikey = prikey;
|
||||
@@ -54,6 +57,7 @@ public class Identity {
|
||||
Pubkey = pubkey;
|
||||
Passwd = passwd;
|
||||
Cert = cert;
|
||||
IsDefault = isDefault;
|
||||
}
|
||||
|
||||
|
||||
@@ -240,16 +244,27 @@ public class Identity {
|
||||
Cert = cert;
|
||||
}
|
||||
|
||||
public boolean isDefault() {
|
||||
return IsDefault;
|
||||
}
|
||||
|
||||
public void setDefault(boolean aDefault) {
|
||||
IsDefault = aDefault;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Identity{" +
|
||||
"Name='" + Name + '\'' +
|
||||
", KeyParam=" + KeyParam +
|
||||
", Prikey=" + Prikey +
|
||||
", KeyParam.signAlgo=" + KeyParam.SignatureAlgorithm +
|
||||
", KeyParam.pubAlgo=" + KeyParam.PublicKeyAlgorithm +
|
||||
", Prikey=" + ByteUtils.toHexString(Prikey.getBytes()) +
|
||||
", pubKey=" + ByteUtils.toHexString(Pubkey.getBytes()) +
|
||||
", PrikeyRawByte=" + (PrikeyRawByte == null ? "null":ByteUtils.toHexString(PrikeyRawByte)) +
|
||||
", Pubkey=" + Pubkey +
|
||||
", Passwd='" + Passwd + '\'' +
|
||||
", Cert=" + Cert +
|
||||
", isDefault=" + IsDefault +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user