Using Curl to Manage CA certificates

upload – allows to download a CA certificate to the device

Example (post request, using curl):

 

curl -i -k -b /tmp/headers --http1.0 -F file=@filename.crt "https://192.168.2.1/api/cacertificates/upload?token=93CFDDC72CE62482990E91B74369FB"

HTTP/1.0 200 OK
Access-Control-Allow-Origin: *
Set-Cookie: token=93CFDDC72CE62482990E91B74369FB; Path=/; Secure
Cache-Control: no-cache
Content-type: application/json
Content-Length: 45
Connection: close
Date: Wed, 13 Jun 2018 14:24:27 GMT
Server: rcell
{
     "code" : 200,
     "status" : "success"
}

remove – allows to remove a CA certificate on the device

Example:

 

Delete request, using curl. E8730CC584B1EB172D71544D8913EE4736438DBF5D3C0F5BFC757E7228A97F73.crt is an internal filename, see in “details” request.

curl -i -k -b /tmp/headers --http1.0 -X "DELETE" "https://192.168.2.1/api/cacertificates/remove/E8730CC584B1EB172D71544D8913EE4736438DBF5D3C0F5BFC757E7228A97F73.crt?token=93CFDDC72CE62482990E91B74369FB"
HTTP/1.0 200 OK
Access-Control-Allow-Origin: *
Set-Cookie: token=93CFDDC72CE62482990E91B74369FB; Path=/; Secure
Cache-Control: no-cache
Content-type: application/json
Content-Length:
Connection: close
Date: Wed, 13 Jun 2018 14:47:39 GMT
Server: rcell
{
    "code" : 200, 
    "status" : "success"
{