These scripts will be run on one of two machines. Each step below notes where it should be run.
- workstation: Your development machine.
- device: The device you're provisioning so that it can talk to Cloud IoT Core.
- [run on workstation] Use
make_ca.shto set up a certificate authority. It will be used to sign devices' certs. When you set up the registry on Cloud IoT Core, supply the CA cert. This is done only once. - [run on device] Run
make_device_key_and_csr.shon the device that you are provisioning. This is important! You should not generate a private key on some other machine (e.g. workstation) and thenscpit to the device. The private key should only ever exist on the device. This will make a.pemfile (the private key) and a.csrfile (the certificate signing request). NOTE: The device ID you provide here MUST be the same as the device ID you enter in the Cloud IoT Core registry. - [run on workstation]
scpthe certificate signing request (the.csrfile) to your workstation. Usesign_csr.shto sign it. The cert will be placed alongside the original.csrfile, and it will have the extension.x509. When you add the device to the Cloud IoT core registry, supply the cert. You can alsoscpthe cert back to the device if you like.