Key Export
Export cryptographic key pairs based on supported algorithms using the walt.id crypto lib.
Exporting as JWK
Here is how you can export a Local Key as JWK:
suspend fun main() {
val jwk = jwkKey.exportJWK()
println("Exported JWK: $jwk")
}
Exporting as JWK Object
If you want to export the JWK Key as a JsonObject representing the JWK, you can do:
suspend fun main() {
val jwkObject = jwkKey.exportJWKObject()
println("Exported JWK Object: $jwkObject")
}
Exporting as PEM (Not yet implemented)
To export the JWK Key as PEM, you can use the following code:
suspend fun main() {
val pem = jwkKey.exportPEM()
println("Exported PEM: $pem")
}
In each case, replace jwkKey with the actual instance of your JWKKey
object.
Note: The export functions are suspendable, so make sure they're called from a coroutine scope or from another suspend function.