Below are described the REST API routes exposed by the KME.
For now, our implementation doesn't support 100% of the features proposed by the official standard (like extensions). This is considered as future work. The main features are however implemented, and should allow you to perform basic QKD key exchanges between SAEs.
Note: SAE ids are 64 bits integers
This route should be called by the master SAE
Get the status of the QKD key exchange with the slave SAE, ie how much exchanged keys are available.
ID of the calling SAE is automatically retrieved from the client certificate.
{
"source_KME_ID": "1",
"target_KME_ID": "2",
"master_SAE_ID": "1",
"slave_SAE_ID": "2",
"key_size": 256,
"stored_key_count": 1,
"max_key_count": 10,
"max_key_per_request": 10,
"max_key_size": 256,
"min_key_size": 256,
"max_SAE_ID_count": 0
}This route should be called by the master SAE
Retrieve one or multiple keys already exchanged between the master KME (the one responding) and the slave KME.
It returns the keys encoded in base64 and the key ID, that should be sent directly to the slave SAE in order to let it retrieve the key.
By default, only one key is requested (empty request body). You can
request multiple keys by specifying the number field in the JSON request
body
(max 10):
{
"number": 3
}{
"keys": [
{
"key_ID": "8844cba7-29e1-3251-a50a-25da13e65eea",
"key": "dGhpc19pc19zZWNyZXRfa2V5XzFfb2ZfMzJfYnl0ZXM="
}
]
}Or for multiple keys:
{
"keys": [
{
"key_ID": "9768257a-1c59-d255-a93d-d4bb1b693651",
"key": "zNK/zOIUDAFyuKRM0dSJLLZVYaDTuhzhAIACBgWABfY="
},
{
"key_ID": "80ccede4-05c9-815a-8e80-d151452bcb82",
"key": "/f8mwVeHSVMWjAAp5GGlSJDJSuB47Agvvo6ta66lIqQ="
},
{
"key_ID": "f6c4a667-23ea-7e58-b07d-95a568d140da",
"key": "6Db9BONohKETQqFPwIEYMS5h0GmskMickEWbowUQsqs="
}
]
}This route should be called by the master SAE
Retrieve one or multiple keys already exchanged between the master KME (the one responding) and the slave KME.
It returns the keys encoded in base64 and the key ID, that should be sent directly to the slave SAE in order to let it retrieve the key.
By default, only one key is requested (no query param). You can
request multiple keys by specifying the number field in the query parameters
(max 10): GET /api/v1/keys/{slave SAE id}/enc_keys?number=3
{
"keys": [
{
"key_ID": "8844cba7-29e1-3251-a50a-25da13e65eea",
"key": "dGhpc19pc19zZWNyZXRfa2V5XzFfb2ZfMzJfYnl0ZXM="
}
]
}Or for multiple keys:
{
"keys": [
{
"key_ID": "9768257a-1c59-d255-a93d-d4bb1b693651",
"key": "zNK/zOIUDAFyuKRM0dSJLLZVYaDTuhzhAIACBgWABfY="
},
{
"key_ID": "80ccede4-05c9-815a-8e80-d151452bcb82",
"key": "/f8mwVeHSVMWjAAp5GGlSJDJSuB47Agvvo6ta66lIqQ="
},
{
"key_ID": "f6c4a667-23ea-7e58-b07d-95a568d140da",
"key": "6Db9BONohKETQqFPwIEYMS5h0GmskMickEWbowUQsqs="
}
]
}This route should be called by the slave SAE
Retrieve on or multiple keys already exchanged between the master KME and the slave KME (the one responding), from the key id.
Key id is the one sent by the master KME.
{
"key_IDs": [
{
"key_ID": "8844cba7-29e1-3251-a50a-25da13e65eea"
},
{
"key_ID": "8844cba7-29e1-3251-a50a-25da13e65eea"
}
]
}{
"keys": [
{
"key_ID": "8844cba7-29e1-3251-a50a-25da13e65eea",
"key": "dGhpc19pc19zZWNyZXRfa2V5XzFfb2ZfMzJfYnl0ZXM="
},
{
"key_ID": "8844cba7-29e1-3251-a50a-25da13e65eea",
"key": "dGhpc19pc19zZWNyZXRfa2V5XzFfb2ZfMzJfYnl0ZXM="
}
]
}This route should be called by the slave SAE
Retrieve a key already exchanged between the master KME and the slave KME (the one responding), from the key id.
Key id is the one sent by the master KME.
Note: Only one key can be requested at a time with this route. For multiple keys, use the POST version of this route.
{
"keys": [
{
"key_ID": "8844cba7-29e1-3251-a50a-25da13e65eea",
"key": "dGhpc19pc19zZWNyZXRfa2V5XzFfb2ZfMzJfYnl0ZXM="
}
]
}This route should be called by any SAE
Get the information of the calling SAE, identified by its certificate serial number.
If the SAE is not registered, a not found error is returned.
{
"SAE_ID": 1
}This route should be called by any SAE
Get the Shannon entropy of all the keys stored in the KME.
{
"total_entropy": 7.919922493186846
}