|
15 | 15 |
|
16 | 16 | package org.fisco.bcos.sdk.config.model; |
17 | 17 |
|
18 | | -import java.io.File; |
19 | 18 | import java.util.Map; |
20 | 19 | import org.fisco.bcos.sdk.config.exceptions.ConfigException; |
21 | 20 | import org.fisco.bcos.sdk.model.CryptoType; |
@@ -124,20 +123,15 @@ public CryptoMaterialConfig getDefaultCaCertPath(int cryptoType, String certPath |
124 | 123 | CryptoMaterialConfig cryptoMaterialConfig = new CryptoMaterialConfig(); |
125 | 124 | cryptoMaterialConfig.setCertPath(certPath); |
126 | 125 | if (cryptoType == CryptoType.ECDSA_TYPE) { |
127 | | - cryptoMaterialConfig.setCaCertPath(certPath + File.separator + "ca.crt"); |
128 | | - cryptoMaterialConfig.setSdkCertPath(certPath + File.separator + "sdk.crt"); |
129 | | - cryptoMaterialConfig.setSdkPrivateKeyPath(certPath + File.separator + "sdk.key"); |
| 126 | + cryptoMaterialConfig.setCaCertPath(certPath + "/" + "ca.crt"); |
| 127 | + cryptoMaterialConfig.setSdkCertPath(certPath + "/" + "sdk.crt"); |
| 128 | + cryptoMaterialConfig.setSdkPrivateKeyPath(certPath + "/" + "sdk.key"); |
130 | 129 | } else if (cryptoType == CryptoType.SM_TYPE) { |
131 | | - cryptoMaterialConfig.setCaCertPath( |
132 | | - certPath + File.separator + File.separator + "sm_ca.crt"); |
133 | | - cryptoMaterialConfig.setSdkCertPath( |
134 | | - certPath + File.separator + File.separator + "sm_sdk.crt"); |
135 | | - cryptoMaterialConfig.setSdkPrivateKeyPath( |
136 | | - certPath + File.separator + File.separator + "sm_sdk.key"); |
137 | | - cryptoMaterialConfig.setEnSdkCertPath( |
138 | | - certPath + File.separator + File.separator + "sm_ensdk.crt"); |
139 | | - cryptoMaterialConfig.setEnSdkPrivateKeyPath( |
140 | | - certPath + File.separator + File.separator + "sm_ensdk.key"); |
| 130 | + cryptoMaterialConfig.setCaCertPath(certPath + "/" + "sm_ca.crt"); |
| 131 | + cryptoMaterialConfig.setSdkCertPath(certPath + "/" + "sm_sdk.crt"); |
| 132 | + cryptoMaterialConfig.setSdkPrivateKeyPath(certPath + "/" + "sm_sdk.key"); |
| 133 | + cryptoMaterialConfig.setEnSdkCertPath(certPath + "/" + "sm_ensdk.crt"); |
| 134 | + cryptoMaterialConfig.setEnSdkPrivateKeyPath(certPath + "/" + "sm_ensdk.key"); |
141 | 135 | } else { |
142 | 136 | throw new ConfigException( |
143 | 137 | "load CryptoMaterialConfig failed, only support ecdsa and sm now, expected 0 or 1, but provided " |
|
0 commit comments