POST /rest/v1/sign
Implementation Notes
Handles the POST request to sign a given message digest within Bosch IoT Rollouts. Required Permission: USE_PRIVATE_KEY
Sign message digest
CURL
$ curl 'https://management-api.host.com/rest/v1/sign' -i -X POST \
-H 'Content-Type: application/json' \
-d '{
"messageDigest" : "n9gGn8Zwo2qvBFF9rI7GxfGCBMI=",
"signingAlgorithm" : "ECDSA_SHA_512",
"keyId" : 1,
"digestEncoding" : "base64"
}'
Request URL
POST /rest/v1/sign HTTP/1.1
Content-Type: application/json
Content-Length: 140
Host: management-api.host.com
{
"messageDigest" : "n9gGn8Zwo2qvBFF9rI7GxfGCBMI=",
"signingAlgorithm" : "ECDSA_SHA_512",
"keyId" : 1,
"digestEncoding" : "base64"
}
Request fields
Path | Type | Description | Allowed Values | Mandatory |
---|---|---|---|---|
keyId |
Number |
The technical identifier of the asymmetric key that should be used to create the digital signature. |
X |
|
messageDigest |
String |
The message digest which shall be signed. |
X |
|
digestEncoding |
String |
The encoding of the message digest |
['hex', 'base64'] |
X |
signingAlgorithm |
String |
The signing algorithm that shall be used to create the digital signature. The referenced key needs to support this algorithm. |
[RSASSA_PSS_SHA_256, RSASSA_PSS_SHA_384, RSASSA_PSS_SHA_512, RSASSA_PKCS1_V1_5_SHA_256, RSASSA_PKCS1_V1_5_SHA_384, RSASSA_PKCS1_V1_5_SHA_512, ECDSA_SHA_256, ECDSA_SHA_384, ECDSA_SHA_512] |
X |
Response (Status 200)
Response fields
Path | Type | Description | Allowed Values |
---|---|---|---|
signature |
String |
The digital signature that was created |
|
signingAlgorithm |
String |
The signing algorithm that was applied to create the digital signature |
[RSASSA_PSS_SHA_256, RSASSA_PSS_SHA_384, RSASSA_PSS_SHA_512, RSASSA_PKCS1_V1_5_SHA_256, RSASSA_PKCS1_V1_5_SHA_384, RSASSA_PKCS1_V1_5_SHA_512, ECDSA_SHA_256, ECDSA_SHA_384, ECDSA_SHA_512] |
Response example
HTTP/1.1 200 OK
Content-Type: application/hal+json
Content-Length: 90
{
"signature" : "onJVE49YPQE8jgh6brV1Jzixm1o=",
"signingAlgorithm" : "ECDSA_SHA_512"
}
Error responses
HTTP Status Code | Reason | Response Model |
---|---|---|
|
Bad Request - e.g. invalid parameters |
|
|
The request requires user authentication. |
|
|
Insufficient permissions, data volume restriction applies or quota limit exceeded. |
See Error body |
|
The http request method is not allowed on the resource. |
|
|
In case accept header is specified and not application/json. |
|
|
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 |
|
The request was attempt with a media-type which is not supported by the server for this resource. |
|
|
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 |