Skip to content

Commit ae5e624

Browse files
committed
docs: uptade README accordingly with the changes proposed in this task
1 parent 2ecfabd commit ae5e624

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/credential/issuance/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ const { credential_configuration_id, credential_identifiers } =
171171
accessToken.authorization_details[0]!;
172172

173173
// Obtain the credential
174-
const { credential } = await Credential.Issuance.obtainCredential(
174+
const { credential, format } = await Credential.Issuance.obtainCredential(
175175
issuerConf,
176176
accessToken,
177177
clientId,
@@ -186,6 +186,10 @@ const { credential } = await Credential.Issuance.obtainCredential(
186186
}
187187
);
188188

189+
// The certificate below is required to perform the `x5chain` validation of credentials in `mdoc` format.
190+
// In a real-world scenario, it must be obtained from the appropriate endpoint exposed by the Trust Anchor
191+
const mockX509CertRoot = format === "mso_mdoc" ? "base64encodedX509CertRoot" : undefined
192+
189193
/*
190194
* Parse and verify the credential. The ignoreMissingAttributes flag must be set to false or omitted in production.
191195
* WARNING: includeUndefinedAttributes should not be set to true in production in order to get only claims explicitly declared by the issuer.
@@ -199,7 +203,8 @@ const { parsedCredential } =
199203
credentialCryptoContext,
200204
ignoreMissingAttributes: true,
201205
includeUndefinedAttributes: false
202-
}
206+
},
207+
mockX509CertRoot
203208
);
204209

205210
const credentialType =

0 commit comments

Comments
 (0)