|
| 1 | +--- |
| 2 | +title: "Create a new directory to complete this tutorial." |
| 3 | +level: 4 |
| 4 | +stepnum: 1 |
| 5 | +ref: create-new-dire |
| 6 | +content: | |
| 7 | + Run the following command to create a new directory for |
| 8 | + the configuration files used in this tutorial: |
| 9 | +
|
| 10 | + .. code-block:: sh |
| 11 | +
|
| 12 | + mkdir client-x509-certs-tutorial |
| 13 | +--- |
| 14 | +title: "Enter your newly created directory." |
| 15 | +level: 4 |
| 16 | +stepnum: 2 |
| 17 | +ref: cd-new-directory |
| 18 | +content: | |
| 19 | + |
| 20 | + .. code-block:: sh |
| 21 | +
|
| 22 | + cd client-x509-certs-tutorial |
| 23 | +--- |
| 24 | +title: "Copy and save the following example JSON." |
| 25 | +level: 4 |
| 26 | +stepnum: 3 |
| 27 | +ref: copy-k8s-user-configmap |
| 28 | +content: | |
| 29 | +
|
| 30 | + In the ``client-x509-certs-tutorial`` directory, save the following |
| 31 | + JSON as ``x509_user.json``: |
| 32 | + |
| 33 | + .. code-block:: json |
| 34 | +
|
| 35 | + { |
| 36 | + "names": [ |
| 37 | + {"O": "organization"}, |
| 38 | + {"OU": "organizationalunit"} |
| 39 | + ], |
| 40 | + "CN": "my-x509-authenticated-user", |
| 41 | + "key": { |
| 42 | + "algo": "rsa", |
| 43 | + "size": 4096 |
| 44 | + } |
| 45 | + } |
| 46 | +
|
| 47 | +--- |
| 48 | +title: "Generate a key file." |
| 49 | +level: 4 |
| 50 | +stepnum: 4 |
| 51 | +ref: gen-key-file |
| 52 | +content: | |
| 53 | +
|
| 54 | + Run the following command to pass the JSON from the previous step |
| 55 | + to ``CFSSL`` and generate a key file: |
| 56 | +
|
| 57 | + .. code-block:: sh |
| 58 | +
|
| 59 | + cfssl genkey x509_user.json > x509_user_key.json |
| 60 | +
|
| 61 | + You should see output similar to the following: |
| 62 | +
|
| 63 | + .. code-block:: sh |
| 64 | + :copyable: false |
| 65 | +
|
| 66 | + 2019/06/04 18:12:38 [INFO] generate received request |
| 67 | + 2019/06/04 18:12:38 [INFO] received CSR |
| 68 | + 2019/06/04 18:12:38 [INFO] generating key: rsa-4096 |
| 69 | + 2019/06/04 18:12:40 [INFO] encoded CSR |
| 70 | +
|
| 71 | + You now have a file called ``x509_user_key.json`` containing |
| 72 | + a new private key. |
| 73 | +--- |
| 74 | +title: "Generate the Certificate Signing Request." |
| 75 | +level: 4 |
| 76 | +stepnum: 5 |
| 77 | +ref: gen-cert-req |
| 78 | +content: | |
| 79 | + Run the following command to use your ``x509_user_key.json`` key |
| 80 | + file to generate a certificate signing request (CSR): |
| 81 | +
|
| 82 | + .. code-block:: sh |
| 83 | +
|
| 84 | + cfssljson -f x509_user_key.json -bare x509_user |
| 85 | +
|
| 86 | + This command generates two files: |
| 87 | +
|
| 88 | + - ``x509_user-key.pem``, the private key for the user |
| 89 | +
|
| 90 | + - ``x509_user.csr``, the CSR that represents the user |
| 91 | +
|
| 92 | +... |
0 commit comments