Skip to content

Commit

Permalink
chore: IATAB2B-57 cnf
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderPostma committed Feb 11, 2025
1 parent 43356c3 commit 638fb4b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/issuer/lib/VcIssuer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,8 +620,8 @@ export class VcIssuer<DIDDoc extends object> {
throw Error(TYP_ERROR)
} else if (!alg) {
throw Error(ALG_ERROR)
} else if (!([kid, jwk, x5c].filter((x) => !!x).length === 1)) {
// only 1 is allowed, but need to look into whether jwk and x5c are allowed together
} else if (x5c && (kid || jwk)) {
// x5c cannot be used together with kid or jwk
throw Error(KID_JWK_X5C_ERROR)
} else if (kid && !did) {
if (!jwk && !x5c) {
Expand Down
2 changes: 1 addition & 1 deletion packages/oid4vci-common/lib/types/OpenID4VCIErrors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const TYP_ERROR = 'Typ must be "openid4vci-proof+jwt"';
export const ALG_ERROR = `Algorithm is a required field, you are free to use the signing algorithm of your choice or one of the following: ${Object.keys(
Alg,
).join(', ')}`;
export const KID_JWK_X5C_ERROR = 'Only one must be present: kid, jwk or x5c';
export const KID_JWK_X5C_ERROR = 'Only one must be present: x5c should not present when kid and/or jwk is already present';
export const KID_DID_NO_DID_ERROR = 'A DID value needs to be returned when kid is present';
export const DID_NO_DIDDOC_ERROR = 'A DID Document needs to be resolved when a DID is encountered';
export const AUD_ERROR = 'aud must be the URL of the credential issuer';
Expand Down

0 comments on commit 638fb4b

Please sign in to comment.