Skip to content

Credential subject identifiers

To identify credential subjects (also known as "credential holders"), Document Rails utilizes credential subject identifiers like JWKs and DIDs.

Credentials are tied to specific keys to correctly identify the credential holder during the presentation process.

Different credential kinds utilize different credential subject identifiers. For information about a specific credential kind, visit the corresponding documentation:

Name Documentation
W3C Link
MDoc Link
SD-JWT Link

Example

import { printRecipe } from "@vaultie/document-rails";

const response = await printRecipe(
    client,
    accessToken,
    organizationId,
    recipeId,
    {
        // ... append other recipe fields.

        credential_subject_ids: {
            [w3cCredentialId]: "did:web:example.com",
            [mdocCredentialId]: {
                alg: 'EdDSA',
                kty: 'OKP',
                crv: 'Ed25519',
                x: 'HltP0A_mCooS0Vv7y82mRYproNRcudqp0jNLUdSmOfI'
            }
        }
    }
);