From 954a919dea8ee8bff159d986597ea6f1511de3a3 Mon Sep 17 00:00:00 2001 From: free will <2647778488@qq.com> Date: Thu, 5 Aug 2021 15:26:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E9=9C=80=E8=A6=81=E5=AF=86=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E8=BA=AB=E4=BB=BD=E5=8A=A0=E8=BD=BD=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E9=83=BD=E6=98=AF=E6=97=A0=E5=AF=86=E7=A0=81=E7=9A=84=EF=BC=8C?= =?UTF-8?q?=E6=89=80=E4=BB=A5=E4=BB=A3=E7=A0=81=E5=9B=9E=E6=BB=9A=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/security/IdentityManager.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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() {