不需要密码,身份加载默认都是无密码的,所以代码回滚了

This commit is contained in:
free will committed 2021-08-05 15:26:56 +08:00
1 parent 71d6a12183
commit 954a919dea
1 file changed
+3 -6
+3 -6
View File
@@ -311,10 +311,10 @@ public class IdentityManager {
* @author hongyu guo
* @date 2021/5/21
**/
public boolean loadCert(String identityName, Certificate cert,String passwd) throws Exception {
public boolean loadCert(String identityName, Certificate cert) throws Exception {
if(existIdentity(identityName)) {
// 已经存在
Identity id = Persist.getIdentityByNameFromStorage(identityName, passwd);
Identity id = Persist.getIdentityByNameFromStorage(identityName, "");
if(id == null)
throw new IdentifyManagerException("can not find identity by name [" + identityName + "] in sqlite");
Certificate oldCert = id.getCert();
@@ -338,9 +338,6 @@ public class IdentityManager {
}
return true;
}
public boolean loadCert(String identityName, Certificate cert) throws Exception {
return loadCert(identityName,cert,"");
}
/**
* 使用指定的网络身份给自己签发一个自签证书
@@ -475,7 +472,7 @@ public class IdentityManager {
public boolean importCert(byte[] bytesOfCert,byte[] passwd) throws Exception {
Certificate cert = CertUtils.fromPem(new String(bytesOfCert), passwd, Common.SM4ECB);
LoggerHelper.info("importing cert: "+cert.toString());
return loadCert(cert.getIssueTo(), cert,new String(passwd));
return loadCert(cert.getIssueTo(), cert);
}
public ConcurrentMap<String, Identity> getIdentifies() {