GET /rest/v1/keys

Implementation notes

Handles the GET request of retrieving all cryptographic keys within Bosch IoT Rollouts. Required permission: READ_KEY

Get paged list of cryptographic keys

CURL

$ curl 'https://management-api.host.com/rest/v1/keys?offset=0&limit=2&sort=id%3AASC' -i -X GET

Request URL

A GET request is used to access the key collection

GET /rest/v1/keys?offset=0&limit=2&sort=id%3AASC HTTP/1.1
Host: management-api.host.com

Request query parameter

Parameter Description

limit

The maximum number of entries in a page (default is 50).

sort

The query parameter sort allows to define the sort order for the result of a query. A sort criteria consists of the name of a field and the sort direction (ASC for ascending and DESC descending). The sequence of the sort criteria (multiple can be used) defines the sort order of the entities in the result.

offset

The paging offset (default is 0).

Request parameter example

GET /rest/v1/keys?offset=0&limit=2&sort=id%3AASC HTTP/1.1
Host: management-api.host.com

Response (Status 200)

Response fields

Path Type Description Allowed Values

total

Number

Total number of elements

size

Number

Current page size

content

Array

List of certificates

content[].id

Number

The technical identifier of the crypto key

content[].keyUsage

String

The key usage

['SIGN_VERIFY']

content[].keySpec

String

The key specification

[RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1]

Response example

HTTP/1.1 200 OK
Content-Type: application/hal+json
Content-Length: 249

{
  "content" : [ {
    "keySpec" : "ECC_NIST_P521",
    "keyUsage" : "SIGN_VERIFY",
    "_links" : {
      "self" : {
        "href" : "https://management-api.host.com/rest/v1/keys/3"
      }
    },
    "id" : 3
  } ],
  "total" : 1,
  "size" : 1
}

Error responses

HTTP Status Code Reason Response Model

400 Bad Request

Bad Request - e.g. invalid parameters

401 Unauthorized

The request requires user authentication.

403 Forbidden

Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or data volume restriction applies.

See Error body

405 Method Not Allowed

The http request method is not allowed on the resource.

406 Not Acceptable

In case accept header is specified and not application/json.

429 Too Many Request

Too many requests. The server will refuse further attempts and the client has to wait another second.

POST /rest/v1/keys

Implementation Notes

Handles the POST request to create a new cryptographic key within Bosch IoT Rollouts. Required Permission: CREATE_KEY

Create cryptographic

CURL

$ curl 'https://management-api.host.com/rest/v1/keys' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "keyUsage" : "SIGN_VERIFY",
  "keySpec" : "ECC_NIST_P521"
}'

Request URL

POST /rest/v1/keys HTTP/1.1
Content-Type: application/json
Content-Length: 63
Host: management-api.host.com

{
  "keyUsage" : "SIGN_VERIFY",
  "keySpec" : "ECC_NIST_P521"
}

Request fields

Path Type Description Allowed Values Mandatory

keyUsage

String

The key usage

['SIGN_VERIFY']

X

keySpec

String

The key specification

[RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1]

X

Response (Status 201)

Response fields

Path Type Description Allowed Values

id

Number

The technical identifier of the crypto key

keyUsage

String

The key usage

['SIGN_VERIFY']

keySpec

String

The key specification

[RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1]

Response example

HTTP/1.1 201 Created
Content-Type: application/hal+json
Content-Length: 180

{
  "keySpec" : "ECC_NIST_P521",
  "keyUsage" : "SIGN_VERIFY",
  "_links" : {
    "self" : {
      "href" : "https://management-api.host.com/rest/v1/keys/5"
    }
  },
  "id" : 5
}

Error responses

HTTP Status Code Reason Response Model

400 Bad Request

Bad Request - e.g. invalid parameters

401 Unauthorized

The request requires user authentication.

403 Forbidden

Insufficient permissions, data volume restriction applies or quota limit exceeded.

See Error body

405 Method Not Allowed

The http request method is not allowed on the resource.

406 Not Acceptable

In case accept header is specified and not application/json.

409 Conflict

E.g. in case an entity is created or modified by another user in another request at the same time. You may retry your modification request.

See Error body

415 Unsupported Media Type

The request was attempt with a media-type which is not supported by the server for this resource.

429 Too Many Request

Too many requests. The server will refuse further attempts and the client has to wait another second.

GET /rest/v1/keys/{keyId}

Implementation Notes

Handles the GET request of retrieving a specific cryptographic key from Bosch IoT Rollouts. Required Permission: READ_KEY

Get single key

CURL

$ curl 'https://management-api.host.com/rest/v1/keys/1' -i -X GET

Request URL

GET /rest/v1/keys/1 HTTP/1.1
Host: management-api.host.com

Request path parameter

Parameter Description

keyId

The technical identifier of the crypto key.

Response (Status 200)

Response fields

Path Type Description Allowed Values

id

Number

The technical identifier of the crypto key

keyUsage

String

The key usage

['SIGN_VERIFY']

publicKey

String

PEM encoded public key

keySpec

String

The key specification

[RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1]

Response example

HTTP/1.1 200 OK
Content-Type: application/hal+json
Content-Length: 277

{
  "keySpec" : "ECC_NIST_P521",
  "keyUsage" : "SIGN_VERIFY",
  "publicKey" : "-----BEGIN PUBLIC KEY----- base64-encoded public key -----END PUBLIC KEY-----",
  "_links" : {
    "self" : {
      "href" : "https://management-api.host.com/rest/v1/keys/1"
    }
  },
  "id" : 1
}

Error responses

HTTP Status Code Reason Response Model

400 Bad Request

Bad Request - e.g. invalid parameters

401 Unauthorized

The request requires user authentication.

403 Forbidden

Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or data volume restriction applies.

See Error body

404 Not Found

Not Found Target.

See Error body

405 Method Not Allowed

The http request method is not allowed on the resource.

406 Not Acceptable

In case accept header is specified and not application/json.

429 Too Many Request

Too many requests. The server will refuse further attempts and the client has to wait another second.

DELETE /rest/v1/keys/{keyId}

Implementation Notes

Handles the DELETE request of deleting a specific cryptographic key from Bosch IoT Rollouts. Required Permission: DELETE_KEY

Delete single key

CURL

$ curl 'https://management-api.host.com/rest/v1/keys/2' -i -X DELETE

Request URL

DELETE /rest/v1/keys/2 HTTP/1.1
Host: management-api.host.com

Request path parameter

Parameter Description

keyId

The technical identifier of the crypto key.

Response (Status 204)

Response example

HTTP/1.1 204 No Content

Error responses

HTTP Status Code Reason Response Model

400 Bad Request

Bad Request - e.g. invalid parameters

401 Unauthorized

The request requires user authentication.

403 Forbidden

Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or data volume restriction applies.

See Error body

404 Not Found

Not Found Target.

See Error body

405 Method Not Allowed

The http request method is not allowed on the resource.

406 Not Acceptable

In case accept header is specified and not application/json.

429 Too Many Request

Too many requests. The server will refuse further attempts and the client has to wait another second.

Additional content

Error body

{
  "errorCode": "string",
  "exceptionClass": "string",
  "message": "string",
  "parameters": [
    "string"
  ]
}

Field description

Field

Description

errorCode

A error code/key set by server

exceptionClass

The involved exceptionClass

message

An error message set by the server

parameters

A list of parameters