getClaim

fun VerifiableCredential.getClaim(key: String): JsonElement?

Get a claim value from the credential subject.

Returns the claim value for the given key, or null if the claim doesn't exist.

Example:

val name = credential.getClaim("name")?.content
val age = credential.getClaim("age")?.longOrNull

Return

The claim value as JsonElement, or null if not found

Parameters

key

The claim key