1. PFX로 변환하기 (Windows IIS용)
# 1) CER/PrivateKey에서 PFX (CER to PFX)
openssl pkcs12 -export -in 인증서.cer -inkey 개인키.key -out 저장인증서.pfx -certfile CA인증서.cer
# 2) PEM/PrivateKey에서 PFX (PEM to PFX)
# let's encrypt certbot certonly로 발급받은 경우, 개인키도 privkey.pem파일로 되어있어 inkey에 pem파일로 넣음 (-inkey 개인키.pem)
openssl pkcs12 -export -in 인증서.pem -inkey 개인키.key -out 저장인증서.pfx
# 3) P7B에서 일단 PEM으로 변환후 2)적용 (P7B to PEM to PFX)
openssl pkcs7 -inform PEM -in 인증서.p7b -print_certs -text -out 저장인증서.pem
2. PEM으로 변환하기 (리눅스용)
# PFX에서 PEM으로 변환 (PFX to PEM)
openssl pkcs12 -in 인증서.pfx -nokeys -out 저장인증서.pem -nodes # 인증서
openssl pkcs12 -in 인증서.pfx -nocerts -out 저장키.key -nodes # 개인키
openssl pkcs12 -in 인증서.pfx -cacerts -nokeys --chine -out ca인증서.cer #CA인증서
# DER/CER에서 PEM (DER to PEM, CER to PEM)
openssl x509 -inform DER -in 인증서.der -out 저장인증서.pem
openssl x509 -in 인증서.cer -outform PEM -out 저장인증서.pem
# P7B에서 PEM으로 변환 (P7B to PEM)
openssl pkcs7 -inform PEM -in 인증서.p7b -print_certs -text -out 저장인증서.pem
3. 기타 변환
# PEM에서 DER 변환 (PEM to DER)
openssl x509 -outform DER -in 인증서.pem -out 저장인증서.der #인증서
openssl ras -in 개인키.pem -pubout -outform DER -out 저장개인키.der #개인키
# PEM에서 P7B 변환 (PEM to P7B)
openssl cr2pkcs7 -nocrl -certifile 인증서.pem -out 저장인증서.p7b -certfile CA인증서.cer
# PEM에서 P12 변환 (PEM to P12)
# PFX에서 각각 공개키, 개인키, CA인증서 추출한 것을 한 파일로 저장
openssl pkcs12 -export -in 인증서.pem -inkey 저장키.key -certfile CA인증서.cer -out 인증서.p12
4. 번들파일 합치기
cat ChainCA1.crt ChainCA2.crt RootCA.crt > Chain_RootCA_Bundel.crt
'Server' 카테고리의 다른 글
SSL인증서 JAVA CA인증서에 루트 인증서 추가하는 방법 (0) | 2024.09.10 |
---|---|
Linux(cent os) teamview 설치하기 (0) | 2020.12.17 |
Apache+Tomcat 연동후 SSL적용 (0) | 2020.01.22 |
Apache v2.2 SSL설치 가이드 (0) | 2020.01.22 |
Unable to read TLD "META-INF/c.tld" from JAR file (0) | 2013.10.17 |