fromJwt

Convert JWT string to credential.

Parses a JWT and extracts the credential from the 'vc' claim. Note: This does not verify the signature. Use CredentialService.verify() for verification.

Example:

val credential = jwtString.fromJwt()
println("Credential ID: ${credential.id}")

Return

Verifiable credential

Throws

if JWT is invalid or missing 'vc' claim


suspend fun String.fromJwt(allowUnsecured: Boolean): VerifiableCredential

Convert JWT string to credential, accepting unsecured (alg: none) JWTs only when allowUnsecured is true.