# 키정보를 담을 경로 생성 [root@spring2-vm ~]# mkdir -p certs # 개인키 생성 [root@spring2-vm ~]# openssl genrsa -des3 -out certs/server.key 2048 Generating RSA private key, 2048 bit long modulus .............................................................................+++ ...............+++ e is 65537 (0x10001) Enter pass phrase for certs/server.key: Verifying - Enter pass phrase for certs/server.key: [root@spring2-vm ~]# ## 개인키패스워드 : 1qazxsw23edC # 키정보로 이동한후 인증서 요청파일 생성 [root@spring2-vm ~]# cd certs/ [root@spring2-vm certs]# [root@spring2-vm certs]# [root@spring2-vm certs]# [root@spring2-vm certs]# openssl req -new -key server.key -out server.csr Enter pass phrase for server.key: You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [XX]:KR State or Province Name (full name) []:Seoul Locality Name (eg, city) [Default City]:Seoul Organization Name (eg, company) [Default Company Ltd]:Korea PE Organizational Unit Name (eg, section) []:IT Common Name (eg, your name or your server's hostname) []:registry.thesanse.com Email Address []:sooabia@gmail.com Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: [root@spring2-vm certs]# [root@spring2-vm certs]# [root@spring2-vm certs]# # 개인키에서 암호 제거 1qazxsw23edC [root@spring2-vm certs]# cp server.key server.key.origin [root@spring2-vm certs]# openssl rsa -in server.key.origin -out server.key Enter pass phrase for server.key.origin: writing RSA key [root@spring2-vm certs]# [root@spring2-vm certs]# rm server.key.origin rm: remove regular file 쁲erver.key.origin [root@spring2-vm certs]# # 앞서만든 인증서 요청파일로 인증서 생성 [root@spring2-vm certs]# openssl x509 -req -days 730 -in server.csr -signkey server.key -out server.cert Signature ok subject=/C=KR/ST=Seoul/L=Seoul/O=Korea PE/OU=IT/CN=registry.thesanse.com/emailAddress=sooabia@gmail.com Getting Private key [root@spring2-vm certs]# [root@spring2-vm certs]#
Overview
Content Tools