How do you use the private key to make a P12 file in BeaconDemo
1, register and login HUAWEI Developer , click "Console"
2, click "凭证"
3, click "创建凭证" --> "服务账号密钥"
4, click "创建并下载json"
5, You can see a JSON file that looks like this
6, Copy the value corresponding to "private_key", paste into a .text file named private_key.text. Edit: Delete "\n" and break every 64 characters
7, Change the private_key.text suffix name to .pem
8, open Shell, cd "path of private_key.pem", Execute the command : openssl rsa -in test.pem -check .If successful, you can see this on the shell
9, Execute the command : openssl req -new -key private_key.pem -out rsaCerReq.csr.
Note: This step will prompt you to enter information such as country, province, mail, etc. You can fill in according to the actual situation, or fill in at will. The "A challenge password" is the password. Write A password that you remember and it will be used later.
10, Execute the command : openssl x509 -req -days 3650 -in rsaCerReq.csr -signkey private_key.pem -out rsaCert.crt
Generate the certificate rsacert.crt and set it to be valid for 10 years
11, Execute the command : openssl x509 -outform der -in rsaCert.crt -out public_key.der
Generate the public key file public_key.der for iOS
12, Execute the command : openssl pkcs12 -export -out private_key.p12 -inkey private_key.pem -in rsaCert.crt
You need to enter the password. This is the password you just set
13, Now you can see the.p12 file, drag it in a BeaconDemo, and you need JWT when you request the network interface, and you need this p12 file to generate the JWT