# These certificates were not used in the build,  

## install the cloudflare SSL generation suite:

```
su -
mkdir -p certs/ca certs/xclarity-administrator certs/xclarity-integrator
cd certs

VERSION=$(curl --silent "https://api.github.com/repos/cloudflare/cfssl/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
VNUMBER=${VERSION#"v"}
wget https://github.com/cloudflare/cfssl/releases/download/${VERSION}/cfssl_${VNUMBER}_linux_amd64 -O cfssl
chmod +x cfssl
sudo mv cfssl /usr/local/bin

VERSION=$(curl --silent "https://api.github.com/repos/cloudflare/cfssl/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
VNUMBER=${VERSION#"v"}
wget https://github.com/cloudflare/cfssl/releases/download/${VERSION}/cfssljson_${VNUMBER}_linux_amd64 -O cfssljson
chmod +x cfssljson
sudo mv cfssljson /usr/local/bin
cfssljson -version
```

## create certificate authority CSR:

```
vi ca-csr.json

{
    "CN": "RDIS Root CA",
    "key": {
      "algo": "rsa",
      "size": 2048
    },
    "names": [
    {
      "C": "GB",
      "L": "University",
	  "O": "University",
	  "OU": "Robotics",
      "ST": "England"
    }
   ]
}
```

## generate CA authority:

```
cfssl gencert -initca ca-csr.json | cfssljson -bare ./ca/ca -
```

## create cfssl profile to define certificate attribute profile "server" that will be used in client certificate generation:

```
vi cfssl-profile.json

{
    "signing": {
      "default": {
        "expiry": "8760h"
      },
      "profiles": {
        "server": {
          "usages": ["signing", "digital signing", "key encipherment", "server auth"],
          "expiry": "8760h"
        }
      }
    }
}
```

## create host CSR config for each appliance:

```
vi xclarity-administrator-csr.json

{
    "CN": "xclarity-administrator",
    "key": {
      "algo": "rsa",
      "size": 2048
    },
    "names": [
    {
      "C": "GB",
      "L": "University",
	  "O": "University",
	  "OU": "Robotics",
      "ST": "England"
    }
    ]
}

vi xclarity-integrator-csr.json

{
    "CN": "xclarity-integrator",
    "key": {
      "algo": "rsa",
      "size": 2048
    },
    "names": [
    {
      "C": "GB",
      "L": "University",
	  "O": "University",
	  "OU": "Robotics",
      "ST": "England"
    }
    ]
}
```

## generate host certificates:

```
cfssl gencert -ca ./ca/ca.pem -ca-key ./ca/ca-key.pem -config cfssl-profile.json -profile=server -hostname=XClarity,129.67.94.17,10.0.1.61,127.0.0.1,localhost xclarity-administrator-csr.json | cfssljson -bare  ./xclarity-administrator/xclarity-administrator

cfssl gencert -ca ./ca/ca.pem -ca-key ./ca/ca-key.pem -config cfssl-profile.json -profile=server -hostname=XClarity-lxci,129.67.94.18,10.0.1.62,127.0.0.1,localhost xclarity-integrator-csr.json | cfssljson -bare ./xclarity-integrator/xclarity-integrator
```

## create full cert chain for each appliance:

```
cd /root/certs
cat ca/ca.pem >> xclarity-administrator/xclarity-administrator-chain.pem
cat xclarity-administrator/xclarity-administrator.pem >> xclarity-administrator/xclarity-administrator-chain.pem
cat xclarity-administrator/xclarity-administrator-key.pem >> xclarity-administrator/xclarity-administrator-chain.pem
```