From b2bcba4e9278f35c401a9bc687f1b741016c11f0 Mon Sep 17 00:00:00 2001 From: severinstampler Date: Tue, 3 Oct 2023 11:01:37 +0200 Subject: [PATCH] fix: trailing tilde in credential jwts in presentation --- .../kotlin/id/walt/credentials/w3c/VerifiablePresentation.kt | 2 +- src/main/kotlin/id/walt/signatory/WaltIdSignatory.kt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/id/walt/credentials/w3c/VerifiablePresentation.kt b/src/main/kotlin/id/walt/credentials/w3c/VerifiablePresentation.kt index 2883ca9e..f74ddbdb 100644 --- a/src/main/kotlin/id/walt/credentials/w3c/VerifiablePresentation.kt +++ b/src/main/kotlin/id/walt/credentials/w3c/VerifiablePresentation.kt @@ -62,7 +62,7 @@ data class PresentableCredential( } else { verifiableCredential.sdJwt!!.present(selectiveDisclosure?.let { SDMapBuilder().addField(claimKey, false, it).build() }) } - JsonPrimitive(presentedJwt.toString(formatForPresentation = true)) + JsonPrimitive(presentedJwt.toString(formatForPresentation = false)) } else verifiableCredential.toJsonElement() val isJwt diff --git a/src/main/kotlin/id/walt/signatory/WaltIdSignatory.kt b/src/main/kotlin/id/walt/signatory/WaltIdSignatory.kt index 8bf57f21..7a3a6e44 100644 --- a/src/main/kotlin/id/walt/signatory/WaltIdSignatory.kt +++ b/src/main/kotlin/id/walt/signatory/WaltIdSignatory.kt @@ -101,7 +101,9 @@ class WaltIdSignatory(configurationPath: String) : Signatory() { val fullProofConfig = fillProofConfig(config) val vcRequest = credentialBuilder.apply { issuer?.let { setIssuer(it) } - setIssuerId(fullProofConfig.issuerDid) + if(issuer?.id.isNullOrEmpty()) { + setIssuerId(fullProofConfig.issuerDid) + } setIssuanceDate(fullProofConfig.issueDate ?: Instant.now()) setIssued(fullProofConfig.issueDate ?: Instant.now()) fullProofConfig.subjectDid?.let { setSubjectId(it) }