diff --git a/src/main/java/security/IdentityManager.java b/src/main/java/security/IdentityManager.java index b432859..0953fb2 100644 --- a/src/main/java/security/IdentityManager.java +++ b/src/main/java/security/IdentityManager.java @@ -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 getIdentifies() {