Trong máy phải cài đặt certificates bao gồm cả private key
Export .p12 với private key (điền mật khẩu)
Export .cer không bao gồm private key (khi export sẽ không yêu cầu cấp mật khẩu).
Tạo file PEM
openssl x509 -in certificates.cer -inform der -out certificates_cer.pem
openssl pkcs12 -in certificates.p12 -out certificates_p12.pem
Ở bước này: sẽ nhập mật khẩu file p12, sau đó mật khẩu file pem.
cat certificates_cer.pem certificates_p12.pem > certificates.pem
Mở terminal tại folder chứa file cert vừa export và nhập theo format
Generate JSON Web Token (JWT) with ES256 algorithm (Các ngôn ngữ Back End đều có hỗ trợ tạo JWT)
Có thể dùng thư viện viết bằng swift này để generate token: https://github.com/ethanhuang13/CupertinoJWT
Sử dụng P12
Export file certificates p12
Trong máy phải cài đặt certificates bao gồm cả private key Export .p12 với điền mật khẩu
Mở terminal tại folder chứa file cert vừa export và nhập theo format
Ví dụ
Sử dụng file PEM
Export file certificates .p12 và file .cer
Trong máy phải cài đặt certificates bao gồm cả private key Export .p12 với private key (điền mật khẩu) Export .cer không bao gồm private key (khi export sẽ không yêu cầu cấp mật khẩu).
Tạo file PEM
Mở terminal tại folder chứa file cert vừa export và nhập theo format
Ví dụ
Sử dụng P8
Yêu cầu
File p8 Team ID Key ID
Generate JSON Web Token (JWT) with ES256 algorithm (Các ngôn ngữ Back End đều có hỗ trợ tạo JWT) Có thể dùng thư viện viết bằng swift này để generate token: https://github.com/ethanhuang13/CupertinoJWT
Mở terminal và nhập theo format
Ví dụ