This is sample code for how to create wallet pass package.
Before running the Demo code, you should have installed Java and Maven. You should have gotten a .pem file and a .cer file.
Oracle Java 1.8 is recommended.
- Edit the
src\test\resources\release.config.properties
according to your service ID, pem file, and cer file.
-
Set the
pass.privatekey.YourServiceID
paramter. For example, if your service ID ishwpass.com.huawei.wallet.pass.sdktest
, rename the paramter topass.privatekey.hwpass.com.huawei.wallet.pass.sdktest
. Then do base64 encoding to the entire .pem file. Then set the base64 string as the value of this paramter. -
Set the
pass.certificate.YourServiceID
paramter. For example, if your service ID ishwpass.com.huawei.wallet.pass.sdktest
, rename the paramter topass.certificate.hwpass.com.huawei.wallet.pass.sdktest
. Then do base64 encoding to the entire .cer file. Then set the base64 string as the value of this paramter.
- Set your service ID to the
TEST_PASS_TYPE
parameter in the "src\test\java\PassFileServiceTestUtil.java" file.
-
Run the
testCreatePassFile
method in the "src\test\java\PassFileReleaseTest.java" file to create a .hwpass file. -
Run the
testCreateMessage
method in the "src\test\java\PassFileReleaseTest.java" file to create a signature.
If you want to evaluate more about HMS Core, r/HMSCore on Reddit is for you to keep up with latest news about HMS Core, and to exchange insights with other developers.
If you have questions about how to use HMS samples, try the following options:
- Stack Overflow is the best place for any programming questions. Be sure to tag your question with
huawei-mobile-services
. - Huawei Developer Forum HMS Core Module is great for general questions, or seeking recommendations and opinions.
If you run into a bug in our samples, please submit an issue to the Repository. Even better you can submit a Pull Request with a fix.
HMS wallet server sample code is licensed under the Apache License, version 2.0.