diff --git a/pom.xml b/pom.xml index da8a503..38a3220 100644 --- a/pom.xml +++ b/pom.xml @@ -436,6 +436,16 @@ src/main/resources true + + *.keystore + + + + src/main/resources + false + + *.keystore + diff --git a/wfc-common/wfc-common-license/src/main/java/org/wfc/common/license/CustomKeyStoreParam.java b/wfc-common/wfc-common-license/src/main/java/org/wfc/common/license/CustomKeyStoreParam.java index 5ca70f6..7d6615c 100644 --- a/wfc-common/wfc-common-license/src/main/java/org/wfc/common/license/CustomKeyStoreParam.java +++ b/wfc-common/wfc-common-license/src/main/java/org/wfc/common/license/CustomKeyStoreParam.java @@ -2,8 +2,6 @@ package org.wfc.common.license; import de.schlichtherle.license.AbstractKeyStoreParam; -import java.io.File; -import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; @@ -54,7 +52,8 @@ public class CustomKeyStoreParam extends AbstractKeyStoreParam { */ @Override public InputStream getStream() throws IOException { - final InputStream in = new FileInputStream(new File(storePath)); +// final InputStream in = new FileInputStream(new File(storePath)); + InputStream in = this.getClass().getClassLoader().getResourceAsStream(storePath); if (null == in) { throw new FileNotFoundException(storePath); } diff --git a/wfc-common/wfc-common-license/src/main/java/org/wfc/common/license/runner/LicenseProperties.java b/wfc-common/wfc-common-license/src/main/java/org/wfc/common/license/runner/LicenseProperties.java index 7066460..cfb5a48 100644 --- a/wfc-common/wfc-common-license/src/main/java/org/wfc/common/license/runner/LicenseProperties.java +++ b/wfc-common/wfc-common-license/src/main/java/org/wfc/common/license/runner/LicenseProperties.java @@ -15,25 +15,25 @@ public class LicenseProperties { /** * 证书subject */ - private String subject; + private String subject = "license_wfc"; /** * 公钥别称 */ - private String publicAlias; + private String publicAlias = "publicCert"; /** * 访问公钥库的密码 */ - private String storePass; + private String storePass = "public_wfc_Admin123"; /** * 证书生成路径 */ - private String licensePath; + private String licensePath = "/opt/wfc/license/license.lic"; /** * 密钥库存储路径 */ - private String publicKeysStorePath; + private String publicKeysStorePath = "publicCerts.keystore"; } diff --git a/wfc-common/wfc-common-license/src/main/resources/application.yml b/wfc-common/wfc-common-license/src/main/resources/application.yml deleted file mode 100644 index 6fc2d6d..0000000 --- a/wfc-common/wfc-common-license/src/main/resources/application.yml +++ /dev/null @@ -1,6 +0,0 @@ -license: - subject: license_demo - publicAlias: publicCert - storePass: public_password1234 - licensePath: D:/workspace/gitee/spring-boot2-license/license/license.lic - publicKeysStorePath: D:/workspace/gitee/spring-boot2-license/license/publicCerts.keystore \ No newline at end of file diff --git a/wfc-gateway/src/main/resources/publicCerts.keystore b/wfc-gateway/src/main/resources/publicCerts.keystore new file mode 100644 index 0000000..c0fdc45 Binary files /dev/null and b/wfc-gateway/src/main/resources/publicCerts.keystore differ