Key management
Key management functions include:
List - lists the available keys
Load - loads a key specified by its alias
Generate - generate a key using the specified algorithm
Import - imports a key
Delete - deletes a specific key
Export - exports public and private key parts (if supported by the underlying keystore)
List keys
The /keys endpoint lists the key available to the Custodian
curl -X 'GET' \
'https://custodian.ssikit.walt.id/keys' \
-H 'accept: application/json'No parameters{
"list":
[
{
"algorithm": "string",
"cryptoProvider": "string",
"keyId":
{
"id": "string"
},
"keyPair": {},
"keysetHandle": null
}
]
}E.g. List the available keys
curl -X 'GET' \
'https://custodian.ssikit.walt.id/keys' \
-H 'accept: application/json'{
"list":
[
{
"algorithm": "EdDSA_Ed25519",
"cryptoProvider": "SUN",
"keyId":
{
"id": "e548f032cadf4145ab6886a57c2e87e6"
},
"keyPair": {},
"keysetHandle": null
},
{
"algorithm": "EdDSA_Ed25519",
"cryptoProvider": "SUN",
"keyId":
{
"id": "e70e8fd8932043caa7c857c3b944d0e0"
},
"keyPair": {},
"keysetHandle": null
},
{
"algorithm": "EdDSA_Ed25519",
"cryptoProvider": "SUN",
"keyId":
{
"id": "b50db0c1f73242b8bb0f2f6324e15ec3"
},
"keyPair": {},
"keysetHandle": null
},
{
"algorithm": "EdDSA_Ed25519",
"cryptoProvider": "SUN",
"keyId":
{
"id": "did:key:z6MkkLmAVeM3P6B2LJ2xGrK1wVojCoephK4G9VrCcct42ADX#z6MkkLmAVeM3P6B2LJ2xGrK1wVojCoephK4G9VrCcct42ADX"
},
"keyPair": {},
"keysetHandle": null
},
{
"algorithm": "EdDSA_Ed25519",
"cryptoProvider": "SUN",
"keyId":
{
"id": "8cc0b1707ea345ed83e479469d42aac2"
},
"keyPair": {},
"keysetHandle": null
},
{
"algorithm": "EdDSA_Ed25519",
"cryptoProvider": "SUN",
"keyId":
{
"id": "did:key:z6Mkv58vGsBMwbiyQ3P93MRnYfRgGvn4STEEsj5hFHYe51wu#z6Mkv58vGsBMwbiyQ3P93MRnYfRgGvn4STEEsj5hFHYe51wu"
},
"keyPair": {},
"keysetHandle": null
},
{
"algorithm": "EdDSA_Ed25519",
"cryptoProvider": "SUN",
"keyId":
{
"id": "186a1e0a6d42459ba902724fe7643ed4"
},
"keyPair": {},
"keysetHandle": null
},
{
"algorithm": "EdDSA_Ed25519",
"cryptoProvider": "SUN",
"keyId":
{
"id": "c5b11445be0e4d37863170df3328630b"
},
"keyPair": {},
"keysetHandle": null
}
]
}Load key
The /keys/{alias} endpoint loads a key specified by its alias.
E.g. Load a key with id e548f032cadf4145ab6886a57c2e87e6
Generate key
The /keys/generate endpoint generates a key using the specified algorithm.
E.g. Generate a key using the EdDSA_Ed25519 algorithm.
Import key
The /keys/import endpoint imports a key (JWK or PEM format) to the underlying keystore.
The key string in JWK or PEM format
E.g. Import a public key specified in JWK format.
Delete key
The /keys/{id} deletes the specified as parameter:
id path parameter (required) - the key alias
E.g. Delete the key with id bc6fa6b0593648238c4616800bed7746
Export key
The /keys/export endpoint exports a key.
E.g. Export the public key with id = e548f032cadf4145ab6886a57c2e87e6 as JWK.
Last updated
Was this helpful?
