Security & Analysis/Security
[Openssl] CA 인증서 생성 및 공개키
sarahee
2023. 12. 12. 20:04
728x90
반응형
openssl
1. CA(Certificate Authority)) 개인키 생성
openssl genrsa -out rootCA.key 2048
2. CA CSR(Certificate Signing Request) 생성
openssl req -new -key rootCA.key -out rootCA.csr
- 인증 서명 요청, 인증서를 발급하는데 필요한 인증 신청서
3. CA CRT 생성
openssl x509 -req -in rootCA.csr -signkey rootCA.key -out rootCA.crt
CA 인증서 생성
공개키 생성(.pem)
# Generate a private key
openssl genpkey -algorithm RSA -out private_key.pem
# Extract the public key from the private key
openssl rsa -pubout -in private_key.pem -out public_key.pem
공개키 변환(.der)
# unable to load certificate
openssl x509 -pubkey -noout -inform PEM -in public_key.pem -outform DER -out public_key.der
# create public_key.pem
openssl pkey -pubout -inform PEM -in private_key.pem -outform DER -out public_key.der
1. ASN.1 구조 확인
openssl asn1parse -inform DER -in public_key.der
2. 16진수 콘텐츠 보기
xxd public_key.der
참고
goldsony.tistory.com/223
728x90
728x90