OpenSSL 을 이용하여 RSA 키(공개키, 개인키)를 생성하는 방법입니다.
OpenSSL 설치
- MacOS
brew install openssl
- Linux
apt-get install openssl
- Windows
- 윈도우 바이너리 버전 다운로드
Create Private Key
genrsa 를 사용하여 1024 크기의 Private Key 생성
openssl genrsa -out private_key.pem 1024
Create Public Key
rsa 명령을 사용하여 Public Key를 생성합니다. 키는 위에서 생성한 Private Key를 이용하여 생성합니다.
(위에서 생성한 비밀키: private_key.pem)
openssl rsa -in private_key.pem -out public_key.pem -pubout