fromJwt

Convert JWT 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. Unsecured (alg: none) JWTs are rejected; see the allowUnsecured overload.

Example:

val credential = credentialService.fromJwt(jwt)

suspend fun CredentialService.fromJwt(jwt: String, allowUnsecured: Boolean): VerifiableCredential

Convert JWT to credential, accepting unsecured (alg: none) JWTs — such as the output of toJwt — only when allowUnsecured is true. The signature is never verified here.