Skip to content

Commit 99c82b8

Browse files
committed
WIP
1 parent e47bcf7 commit 99c82b8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

wallet-core/src/main/java/eu/europa/ec/eudi/wallet/transfer/openid4vp/responseGenerator/OpenId4VpSdJwtResponseGeneratorImpl.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import eu.europa.ec.eudi.sdjwt.present
3333
import eu.europa.ec.eudi.sdjwt.serializeWithKeyBinding
3434
import eu.europa.ec.eudi.wallet.internal.Openid4VpX509CertificateTrust
3535
import eu.europa.ec.eudi.wallet.issue.openid4vci.DocumentManagerSdJwt
36+
import eu.europa.ec.eudi.wallet.issue.openid4vci.pem
3637
import eu.europa.ec.eudi.wallet.keystore.DEV_KEY_ALIAS
3738
import eu.europa.ec.eudi.wallet.keystore.KeyGenerator
3839
import eu.europa.ec.eudi.wallet.keystore.KeyGeneratorImpl
@@ -72,9 +73,13 @@ class OpenId4VpSdJwtResponseGeneratorImpl(
7273
throw Exception()
7374
}
7475
val pemString = "-----BEGIN CERTIFICATE-----\n" +
75-
"${key.privateKey}\n" +
76+
"${key.certificate.publicKey.pem}\n" +
7677
"-----END CERTIFICATE-----"
77-
val ecKey = ECKey.parse(pemString)
78+
79+
val certificateFactory: CertificateFactory = CertificateFactory.getInstance("X.509")
80+
val certificate =
81+
certificateFactory.generateCertificate(ByteArrayInputStream(key.certificate.publicKey.pem.toByteArray())) as X509Certificate
82+
val ecKey = ECKey.parse(certificate)
7883

7984
val signer = ECDSASigner(ecKey)
8085

0 commit comments

Comments
 (0)