openssl 설치를 먼저 해야함


> openssl genrsa -out private.key 2048

Generating RSA private key, 2048 bit long modulus

......................................................+++

.......................................................+++

e is 65537 (0x010001)


> openssl rsa -in private.key -pubout -out public.key

writing RSA key



> set OPENSSL_CONF=C:/mine/program/openssl-0.9.8k_X64/openssl.cnf


> openssl req -new -key private.key -out private.csr

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) [AU]:KR

State or Province Name (full name) [Some-State]:Seoul

Locality Name (eg, city) []:Seoul

Organization Name (eg, company) [Internet Widgits Pty Ltd]:test

Organizational Unit Name (eg, section) []:develop

Common Name (eg, YOUR name) []:localhost

Email Address []:test@test.com


Please enter the following 'extra' attributes

to be sent with your certificate request

A challenge password []:asdf

An optional company name []:asdf



> openssl genrsa -aes256 -out rootCA.key 2048

Generating RSA private key, 2048 bit long modulus

..............................................................................................+++

.......................................+++

e is 65537 (0x010001)

Enter pass phrase for rootCA.key:

Verifying - Enter pass phrase for rootCA.key:


> openssl req -x509 -new -nodes -key rootCA.key -days 3650 -out rootCA.pem

Enter pass phrase for rootCA.key: asdf

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) [AU]:KR

State or Province Name (full name) [Some-State]:Seoul

Locality Name (eg, city) []:Seoul

Organization Name (eg, company) [Internet Widgits Pty Ltd]:test

Organizational Unit Name (eg, section) []:develop

Common Name (eg, YOUR name) []:test

Email Address []:test@test.com


> openssl x509 -req -in private.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out private.crt -days 3650

Signature ok

subject=C = KR, ST = Seoul, L = Seoul, O = google, OU = develop, CN = localhost, emailAddress = test@test.com

Getting CA Private Key

Enter pass phrase for rootCA.key:



> 생성된 파일

private.crt

private.csr

private.key

public.key

rootCA.key

rootCA.pem

rootCA.srl