Add Certificate
Scenario Overview
Adds or Update a certificate in the Crosswork. You can add certificates for these roles.
- External Destination
- Server Syslog Communication
- Devices gNMI communication
- Secure LDAP Communication
- External Destination Server Auth
- Application External Destination
Prerequisites
- Before running this example, ensure to obtain access token. Refer 'Getting Started' section.
- All certificates that are uploaded must be in Privacy Enhanced Mail (PEM) format.
- Trust chain files that are uploaded may contain the entire hierarchy (root CA and intermediate certificates) in the same file.
- Intermediate Keys need to be either PKCS1 or PKCS8 format.
- A data destination must be configured prior to adding a new certificate for an external destination.
Add Certificate
Run the script _add_cert from the example directory.
cd cnc-tls-api-examples;./add_cert.sh
Script Details
#!/bin/bash
. ./cnc-api-common.sh
add_cert() {
# assume cnc jwt is obtained prior to invoking this method by executing get-cnc-jwt.sh script
# read from jwt file and export it as AUTH_TOKEN_HDR
export_jwt
# STEP 1 : User to update input json with details of job to be created in the file CNC_API_INPUT
# STEP 2 : trigger add cert API
# STEP 3 : store the output in CNC_API_OUTPUT file
CNC_TLS_API=$CNC_TLS_API_CTX/cert/update
CNC_API_INPUT="@$PRJ/input/add_cert.json"
CNC_API_OUTPUT="$PRJ/output/add_cert_response.json"
http_post $CNC_API_URL $CNC_API_INPUT $CNC_API_OUTPUT
}
add_cert