// Response Messages from the target for the InstallCertificateRequest. message InstallCertificateResponse { // Response messages. oneof install_response { GenerateCSRResponse generated_csr = 1; LoadCertificateResponse load_certificate = 2; } } // GenerateCSRResponse contains the CSR associated with the Certificate ID // supplied in the GenerateCSRRequest. When a Certificate is subsequently // installed on the target in the same streaming RPC session, it must be // associated to that Certificate ID. // // An Unimplemented error will be returned if the target cannot generate a CSR // as per the request. In this case, the caller must generate its own key pair.
message GenerateCSRResponse { CSR csr = 1; } // A Certificate Signing Request. message CSR { // Type of certificate. CertificateType type = 1; // Bytes representing the CSR. // The exact encoding depends upon the type of certificate requested. // for X509: This should be the PEM encoded CSR. bytes csr = 2; } After the target device is up and gNOI is in default state, the controller (a third-party implementation) uses the Install RPC to install a certificate that is signed by a Certificate Authority (CA). The certificate is uniquely identified by a certificate ID. This ID is used as the trustpoint name in the Public Key Infrastructure (PKI) configuration.
The installation will fail, if you try to install a certificate that has an existing certificate ID. The following section describes how a CSR is generated by a device: 1. The device generates a self-signed certificate through the Install RPC. The controller does not require a copy of this certificate because in encrypted mode (or gNMI default state) the controller does not validate the certificate presented by the target device. This is the default state. 2. The controller requests the device to generate a CSR, sends the CSR to the CA, and gets the signed certificate back from the CA. 3.
The signed certificate is installed into the device along with the CA certificates used to sign the certificate. The CA certificate is present in the ca_certificates bundle, and is required by the PKI to install the device certificate. 4. The gNMI or the gNOI service restarts using the newly installed certificate that is now in the provisioned state. Rotate RPC The Rotate RPC renews an existing certificate; a certificate that is already installed. If a certificate is not already installed, the Rotate RPC fails. A certificate that is not in use can be rotated, but the client cannot test it. The following is a sample Rotate RPC definition:
Model-Driven Programmability Rotate RPC Programmability Configuration Guide, Cisco IOS XE 17.16.x 278