Skip to content

SD-JWT

Both regular SD-JWT credentials and KB-JWT presentations are supported by Document Rails, with verification performed against a list of trusted JWKs.

Output

Name Value Description
kind sd-jwt Credential kind identifier
vct Optional string value Credential type
fields JSON object Fields detected within the credential

Example output

{
    "credentials": [
        {
            "kind": "sd-jwt",
            "vct": "https://example.com/credential/pid/1.0",
            "fields": {
                "given_name": "John",
                "family_name": "Doe"
            }
        }
    ]
}

Example

import { verify, VerifyInputKind } from "@vaultie/document-rails";

const response = await verify(
    client,
    accessToken,
    organizationId,
    {
        input: {
            kind: VerifyInputKind.SDJWT,
            data: "eyJ0eXAiOiJ2Yy..."
        },
        trust_registries: [trustRegistryId],
    }
);