From 475b9a518486e14fb05ef8303253ff6d049686fc Mon Sep 17 00:00:00 2001 From: caiyuchao Date: Tue, 15 Apr 2025 16:49:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20license=E5=85=AC=E9=92=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 10 ++++++++++ .../wfc/common/license/CustomKeyStoreParam.java | 5 ++--- .../common/license/runner/LicenseProperties.java | 10 +++++----- .../src/main/resources/application.yml | 6 ------ .../src/main/resources/publicCerts.keystore | Bin 0 -> 878 bytes 5 files changed, 17 insertions(+), 14 deletions(-) delete mode 100644 wfc-common/wfc-common-license/src/main/resources/application.yml create mode 100644 wfc-gateway/src/main/resources/publicCerts.keystore 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 0000000000000000000000000000000000000000..c0fdc459bfe96afb98b5608ae256577ff45fd8f4 GIT binary patch literal 878 zcmezO_TO6u1_mY|W(3n*1*J(jnaRniMI}I?X(kry4=}Js=$RT=GB7Y}8#FPi8#FOJ zTENW2$i&2=)Be@jfR~Lkq0NIam6?T^iIu@1*^t|SlZ`o)g-w{r*$>9y5M~PYfN|Kt z93cY%kTNb|&Yb+@#GH)$;u1rs7&jI%W+X8KIdNViQv(x26GJ0ILsR1@ab9B(*9gj` zk0Y8Gw;MDu>aekEwRxPgU||GuH_Da@X$IZ*nxpsT$@6c5+k!1|)JJPl{;@AG8Uw0XNJ3Tuz=X#@cgRDvZr?iCa*)s!{E}1|71xvMn z(joudE3g0CeoXp@b@=mRE0&4!v;1!UcKN8>VJ6cM;V7|*M&C+5uhUMvuJ!(t60_vo ziyn-}nM4_;Cj|71Ds!LNG-+qkqSr0lA0lMFf}HmK;eys{vu*F4-m^N!Y)AOc$|>u2 z|FU}3^fTOt+m^j4Juou7Z`YMb|7V5l0*wt@JjDu?U-)Q<32#5oY1DIK*+Uz#s_u}Q zUX2Hf*U4#bURF9WZ*e{MFGbU&kH3?u7*(v#Ecv)^Mc{^^dgb2!bn(jI+q=C! z&(vJE=iL5|hs#ZK*`7s4bVk4RIawXg&Sbi)!bR`i{&efuxQG1g60Lb2+ihP>I#;`E zPY`=a-=&Y0_FQ#c2ey7_E&CC4QrXR)?Qp@9OK*4&g@-S`AZC?nop{r9zU+#{iU#rq zvcS|Q%f}+dBJv{Juv5MAdu3WJTF@3Z4Fy8^RWX){AV4w>O*fys#`__5i`FU&- zPsDcx=BH00d!I6iWK6vNq_O{v!*3UlSpNuCD3M HG#mf`lo3JH literal 0 HcmV?d00001