PKI와 인증서 관리
PKI 완벽 가이드
1. PKI (Public Key Infrastructure)
공개키 암호화 기반의 신뢰 체계
CA (인증 기관)
↓ 서명
인증서
↓ 포함
공개키 + 도메인 정보
2. 인증서 체인
Root CA (신뢰 앵커)
↓ 서명
Intermediate CA
↓ 서명
Leaf Certificate (example.com)
검증 과정
1. 브라우저가 example.com 인증서 받음
2. Intermediate CA로 서명 검증
3. Root CA로 Intermediate 검증
4. Root CA는 브라우저에 내장됨 (신뢰)
3. 인증서 생성
# 개인키 생성
openssl genrsa -out private.key 2048
# CSR (Certificate Signing Request) 생성
openssl req -new -key private.key -out request.csr
# CA가 서명 (인증서 발급)
openssl x509 -req -in request.csr -CA ca.crt -CAkey ca.key -out certificate.crt
4. Let's Encrypt
# 무료 SSL 인증서
sudo certbot --nginx -d example.com
# 자동 갱신
sudo certbot renew
결론
PKI는 인터넷 보안의 핵심 인프라입니다.