Skip to content

Commit 3f47ee2

Browse files
committed
Only add kid if present
1 parent 1329bf9 commit 3f47ee2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Controllers/VerifiableCredentials/CredentialIssuerCredentialController.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -702,9 +702,9 @@ public function credential(Request $request): Response
702702
ClaimsEnum::Vct->value => $resolvedCredentialIdentifier,
703703
];
704704

705-
if ($proof instanceof OpenId4VciProof) {
705+
if ($proof instanceof OpenId4VciProof && is_string($proofKeyId = $proof->getKeyId())) {
706706
$sdJwtPayload[ClaimsEnum::Cnf->value] = [
707-
ClaimsEnum::Kid->value => $proof->getKeyId(),
707+
ClaimsEnum::Kid->value => $proofKeyId,
708708
];
709709
}
710710

@@ -716,7 +716,6 @@ public function credential(Request $request): Response
716716
ClaimsEnum::Kid->value => $issuerDid . '#0',
717717
],
718718
disclosureBag: $disclosureBag,
719-
jwtTypesEnum: JwtTypesEnum::DcSdJwt,
720719
);
721720
}
722721

@@ -741,9 +740,9 @@ public function credential(Request $request): Response
741740
ClaimsEnum::Jti->value => $vcId,
742741
];
743742

744-
if ($proof instanceof OpenId4VciProof) {
743+
if ($proof instanceof OpenId4VciProof && is_string($proofKeyId = $proof->getKeyId())) {
745744
$sdJwtPayload[ClaimsEnum::Cnf->value] = [
746-
ClaimsEnum::Kid->value => $proof->getKeyId(),
745+
ClaimsEnum::Kid->value => $proofKeyId,
747746
];
748747
}
749748

0 commit comments

Comments
 (0)