This guide documents the process of generating a PKCS#12 certificate file from Sectigo SSL certificates for use with Spring Boot applications.
- SSL certificate files from Sectigo
- Private key file (generated during CSR creation)
- OpenSSL installed on the system
STAR_axaipay_my/
├── 2025ssl.csr # Certificate Signing Request
├── 2025ssl.key # Private Key
├── STAR_axaipay_my.crt # Main SSL Certificate
├── SectigoPublicServerAuthenticationCADVR36.crt # Intermediate Certificate
├── SectigoPublicServerAuthenticationRootR46_USERTrust.crt # Root Certificate
└── USERTrustRSACertificationAuthority.crt # Root Authority Certificate
Combine the main certificate with intermediate certificates to create a complete chain:
cd "/Users/alifhaikal88/Documents/COMPANY/AXAIPAY/SSL/Axaipay SSL 2026/STAR_axaipay_my"
cat STAR_axaipay_my.crt SectigoPublicServerAuthenticationCADVR36.crt SectigoPublicServerAuthenticationRootR46_USERTrust.crt > certificate_chain.crt
Create the PKCS#12 file with the private key, certificate, and chain:
openssl pkcs12 -export \
-out axaipay_my.p12 \
-inkey 2025ssl.key \
-in STAR_axaipay_my.crt \
-certfile certificate_chain.crt \
-name "*.axaipay.my SSL Certificate" \
-passout pass:"bayar@xai123$"
Check the file was created successfully:
ls -la *.p12
Verify the PKCS#12 structure:
openssl pkcs12 -info -in axaipay_my.p12 -noout -passin pass:"bayar@xai123$"
The PKCS#12 file is configured for use with Spring Boot:
# SSL configuration
server.ssl.key-store-type=PKCS12
server.ssl.key-store=classpath:keystore/axaipay_my.jks
server.ssl.key-store-password=bayar@xai123$
- File Location: Place
axaipay_my.p12
insrc/main/resources/keystore/
directory - File Extension: Update configuration to use
.p12
extension instead of.jks
- Password: The keystore password matches the configuration:
bayar@xai123$
server.ssl.key-store-type=PKCS12
server.ssl.key-store=classpath:keystore/axaipay_my.p12
server.ssl.key-store-password=bayar@xai123$
# Navigate to certificate directory
cd "/Users/alifhaikal88/Documents/COMPANY/AXAIPAY/SSL/Axaipay SSL 2026/STAR_axaipay_my"
# Create certificate chain
cat STAR_axaipay_my.crt SectigoPublicServerAuthenticationCADVR36.crt SectigoPublicServerAuthenticationRootR46_USERTrust.crt > certificate_chain.crt
# Generate PKCS#12 file
openssl pkcs12 -export -out axaipay_my.p12 -inkey 2025ssl.key -in STAR_axaipay_my.crt -certfile certificate_chain.crt -name "*.axaipay.my SSL Certificate" -passout pass:"bayar@xai123$"
# Verify generation
ls -la *.p12
openssl pkcs12 -info -in axaipay_my.p12 -noout -passin pass:"bayar@xai123$"