Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

package org.fisco.bcos.sdk.config.model;

import java.io.File;
import java.util.Map;
import org.fisco.bcos.sdk.config.exceptions.ConfigException;
import org.fisco.bcos.sdk.model.CryptoType;
Expand Down Expand Up @@ -124,20 +123,15 @@ public CryptoMaterialConfig getDefaultCaCertPath(int cryptoType, String certPath
CryptoMaterialConfig cryptoMaterialConfig = new CryptoMaterialConfig();
cryptoMaterialConfig.setCertPath(certPath);
if (cryptoType == CryptoType.ECDSA_TYPE) {
cryptoMaterialConfig.setCaCertPath(certPath + File.separator + "ca.crt");
cryptoMaterialConfig.setSdkCertPath(certPath + File.separator + "sdk.crt");
cryptoMaterialConfig.setSdkPrivateKeyPath(certPath + File.separator + "sdk.key");
cryptoMaterialConfig.setCaCertPath(certPath + "/" + "ca.crt");
cryptoMaterialConfig.setSdkCertPath(certPath + "/" + "sdk.crt");
cryptoMaterialConfig.setSdkPrivateKeyPath(certPath + "/" + "sdk.key");
} else if (cryptoType == CryptoType.SM_TYPE) {
cryptoMaterialConfig.setCaCertPath(
certPath + File.separator + File.separator + "sm_ca.crt");
cryptoMaterialConfig.setSdkCertPath(
certPath + File.separator + File.separator + "sm_sdk.crt");
cryptoMaterialConfig.setSdkPrivateKeyPath(
certPath + File.separator + File.separator + "sm_sdk.key");
cryptoMaterialConfig.setEnSdkCertPath(
certPath + File.separator + File.separator + "sm_ensdk.crt");
cryptoMaterialConfig.setEnSdkPrivateKeyPath(
certPath + File.separator + File.separator + "sm_ensdk.key");
cryptoMaterialConfig.setCaCertPath(certPath + "/" + "sm_ca.crt");
cryptoMaterialConfig.setSdkCertPath(certPath + "/" + "sm_sdk.crt");
cryptoMaterialConfig.setSdkPrivateKeyPath(certPath + "/" + "sm_sdk.key");
cryptoMaterialConfig.setEnSdkCertPath(certPath + "/" + "sm_ensdk.crt");
cryptoMaterialConfig.setEnSdkPrivateKeyPath(certPath + "/" + "sm_ensdk.key");
} else {
throw new ConfigException(
"load CryptoMaterialConfig failed, only support ecdsa and sm now, expected 0 or 1, but provided "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ protected String getKeyStoreFilePath(String address, String postFix) {
if (config != null) {
keyStoreFileDir = config.getAccountConfig().getKeyStoreDir();
}
keyStoreFileDir = keyStoreFileDir + File.separator + keyStoreSubDir + File.separator;
keyStoreFileDir = keyStoreFileDir + "/" + keyStoreSubDir + "/";
return keyStoreFileDir + address + postFix;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,9 @@ public void testSignAndVerifyWithKeyManager() {
public String getKeyStoreFilePath(
CryptoSuite cryptoSuite, ConfigOption configOption, String postFix) {
return configOption.getAccountConfig().getKeyStoreDir()
+ File.separator
+ "/"
+ cryptoSuite.getCryptoKeyPair().getKeyStoreSubDir()
+ File.separator
+ "/"
+ cryptoSuite.getCryptoKeyPair().getAddress()
+ postFix;
}
Expand Down