openssl genrsa -out ca.key 2048で作成する
genrsaのオプションを確認しておこう。-out fileでファイルを作成する。2048は2048bitという意味。
usage: genrsa [args] [numbits]
-des encrypt the generated key with DES in cbc mode
-des3 encrypt the generated key with DES in ede cbc mode (168 bit key)
-idea encrypt the generated key with IDEA in cbc mode
-seed
encrypt PEM output with cbc seed
-aes128, -aes192, -aes256
encrypt PEM output with cbc aes
-camellia128, -camellia192, -camellia256
encrypt PEM output with cbc camellia
-out file output the key to ‘file
-passout arg output file pass phrase source
-f4 use F4 (0x10001) for the E value
-3 use 3 for the E value
-engine e use engine e, possibly a hardware device.
-rand file:file:…
load the file (or the files in the directory) into
the random number generator
openssl genrsa -out ca.key 2048と打ち込みます。
[vagrant@localhost ssl]$ openssl genrsa -out ca.key 2048 Generating RSA private key, 2048 bit long modulus ..............+++ .....+++ e is 65537 (0x10001)
ca.keyができるのがわかります。
[vagrant@localhost ssl]$ ls ca.key
ca.keyの中身を見てみます。
-----BEGIN RSA PRIVATE KEY----- MIIEogIBAAKCAQEAmJ4B3ZcX+fD+dDWaE+76QxYd8Z9ooLwGWneFfpZyOYBDP291 rMMzVrSA/tAH0HfXFBKuP8rmtEB23YEzcy4OKOrTXIZqoKfGO6tTgDQYFSTvGJoN WSpf3CZqqVy6nTyeOOUfMiN6SdWgZV6ZNYx3OPpCacPCVpaYgmLAVL7MmQr+nTGs fFzB8G3acReKaEa1LFDUbMf1TYj+pK6cNy5KDU3jKLbfWHf6o+n7rFi4ZhLw6DCD HEJpy2CLxO/RdjpC7Vil+eJl99AdIbGOOdRwAnJZ5TfNzINXKg91jWYByaIc0kqS Vj4snaHADrJkEiKF//B17qsbPXFwG2WbcA+A2wIDAQABAoIBAChWixOwneu4IOlC Sak/HvKgY+W7RoJFcEB1GtmsliBQoHWh1i6FoYonR3kSLx6Qrk5l6Zx+2p+F8mT1 g03MPH3gI2FvPbuc3K5kyDs4iaz9CB0uipyosJGVrdd55PEuVnufQ7GS4v2k8zIX 4NLgf5qVuvwNe847G7BKvZ8olxdUAh5HEbi8OigI3jHJk/uEXrp48aLF9uU/u6l9 AOwOo44bh0adt1Iu+7HAxS/huFXxwlLqxkCW3iYrAG6A9EgScGdljg7L812meRNJ Am6/1euX8Zq/rWPkiXds2yTiY5RmI/1TeaHhhLqOMqkGbpxYPCial6uFYfiCgF/Q uH2tfvECgYEAxzD7M/JMNDQC2Ak9jEMKABFlC60p4BhdFi0KRMZbBfNrBnR/f4zg +t5dtVzFJX0k5fPD5Dx5KV1LGsmbQNzvfBtvNcraXjICGWEUwaTVV16WkHJt30c8 FeN27pTFXS30qAgPDPn818nQvdesVjEghL1Z/B6jmodtKsGcUkDYPC8CgYEAxCSi hoehoge -----END RSA PRIVATE KEY-----
できてます。