The following key management functions are available:
load - load the public key in JWK format
List key ids
The /v1/key
endpoint lists the available key ids.
curl -X 'GET' \
'https://core.ssikit.walt.id/v1/key' \
-H 'accept: application/json'
E.g. List the available key ids.
curl -X 'GET' \
'https://core.ssikit.walt.id/v1/key' \
-H 'accept: application/json'
[
"e548f032cadf4145ab6886a57c2e87e6",
"e70e8fd8932043caa7c857c3b944d0e0",
"b50db0c1f73242b8bb0f2f6324e15ec3",
"did:key:z6MkkLmAVeM3P6B2LJ2xGrK1wVojCoephK4G9VrCcct42ADX#z6MkkLmAVeM3P6B2LJ2xGrK1wVojCoephK4G9VrCcct42ADX",
"8cc0b1707ea345ed83e479469d42aac2",
"c5b11445be0e4d37863170df3328630b",
"8394ea7883bc4328a3f18b146b7e16bd",
"fd36a0159592413da1d89f192dd77dcd",
"did:key:z6Mkm8NbvDnnxJ2t5zLGSkYGCWZiqq11Axr58xQ3ZG1Jss3z#z6Mkm8NbvDnnxJ2t5zLGSkYGCWZiqq11Axr58xQ3ZG1Jss3z",
"fa9296808e64440d89e6d245a1709141",
"8dd54d6ae25a4818b1497530a8659dc1"
]
Load key
The /v1/key/{id}
endpoint loads the public component of the provided key id in JWK format:
id - path parameter (required) - the key id
curl -X 'GET' \
'https://core.ssikit.walt.id/v1/key/{id}' \
-H 'accept: application/json'
The string for the public component of the key
E.g. Load the key having id = e548f032cadf4145ab6886a57c2e87e6.
curl -X 'GET' \
'https://core.ssikit.walt.id/v1/key/e548f032cadf4145ab6886a57c2e87e6' \
-H 'accept: application/json'
"{\"kty\":\"OKP\",\"use\":\"sig\",\"crv\":\"Ed25519\",\"kid\":\"e548f032cadf4145ab6886a57c2e87e6\",\"x\":\"jT8YleOQnaABpZTnvId3WoID4Pia9Lex9OndqQ22Xxs\",\"alg\":\"EdDSA\"}"
Delete key
The /v1/key/{id}
endpoint deletes the specified key.
curl -X 'DELETE' \
'https://core.ssikit.walt.id/v1/key/' \
-H 'accept: application/json' \
-H 'Content-Type: text/plain' \
-d '<request-body>'
E.g. Delete the key having id = e548f032cadf4145ab6886a57c2e87e6.
curl -X 'DELETE' \
'https://core.ssikit.walt.id/v1/key/' \
-H 'accept: application/json' \
-H 'Content-Type: text/plain' \
-d 'e548f032cadf4145ab6886a57c2e87e6'
e548f032cadf4145ab6886a57c2e87e6
Generate key
The /v1/key/gen
generates a new key using the specified algorithm.
curl -X 'POST' \
'https://core.ssikit.walt.id/v1/key/gen' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '<request-body>'
{
"keyAlgorithm": "EdDSA_Ed25519"
}
E.g. Generate a new key using the EdDSA_Ed25519 algorithm.
curl -X 'POST' \
'https://core.ssikit.walt.id/v1/key/gen' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"keyAlgorithm": "EdDSA_Ed25519"
}'
{
"keyAlgorithm": "EdDSA_Ed25519"
}
{
"id": "2251db0d15eb4e96b80c471edbaed185"
}
Import key
The /v1/key/import
endpoint imports a key (JWK or PEM format) to the underlying keystore.
curl -X 'POST' \
'https://core.ssikit.walt.id/v1/key/import' \
-H 'accept: application/json' \
-H 'Content-Type: text/plain' \
-d '<request-body>'
The key string in JWK or PEM format
E.g. Import a public key specified in JWK format.
curl -X 'POST' \
'https://core.ssikit.walt.id/v1/key/import' \
-H 'accept: application/json' \
-H 'Content-Type: text/plain' \
-d '{"kty":"OKP","use":"sig","crv":"Ed25519","kid":"bc6fa6b0593648238c4616800bed7746","x":"YyswAyRO2Aur8Jmzc8aOvI3AWFka3ZynJwB84a0FJVU","alg":"EdDSA"}'
{
"kty": "OKP",
"use": "sig",
"crv": "Ed25519",
"kid": "bc6fa6b0593648238c4616800bed7746",
"x": "YyswAyRO2Aur8Jmzc8aOvI3AWFka3ZynJwB84a0FJVU",
"alg": "EdDSA"
}
{
"id": "bc6fa6b0593648238c4616800bed7746"
}
Export key
The /v1/key/export
endpoint exports public and private key part (if supported by underlying keystore).
curl -X 'POST' \
'https://core.ssikit.walt.id/v1/key/export' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '<request-body>'
{
"keyAlias": "string",
"format": "JWK",
"exportPrivate": true
}
The key in the specified format, JWK or PEM
E.g. Export the public key with id = bc6fa6b0593648238c4616800bed7746 as JWK.
curl -X 'POST' \
'https://core.ssikit.walt.id/v1/key/export' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"keyAlias": "bc6fa6b0593648238c4616800bed7746",
"format": "JWK",
"exportPrivate": false
}'
{
"keyAlias": "bc6fa6b0593648238c4616800bed7746",
"format": "JWK",
"exportPrivate": false
}
{
"kty": "OKP",
"use": "sig",
"crv": "Ed25519",
"kid": "bc6fa6b0593648238c4616800bed7746",
"x": "YyswAyRO2Aur8Jmzc8aOvI3AWFka3ZynJwB84a0FJVU",
"alg": "EdDSA"
}