From 9f2bebaaeb9fd066df585d94aadbe33d527dda80 Mon Sep 17 00:00:00 2001 From: Menkene Koufan Date: Fri, 31 Jan 2025 11:22:07 +0100 Subject: [PATCH] fixed quality gate --- .../impl/BankAccountCertificateCreationServiceImpl.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/webank-bank-account/webank-bank-account-service-impl/src/main/java/de/adorsys/webank/bank/api/service/impl/BankAccountCertificateCreationServiceImpl.java b/webank-bank-account/webank-bank-account-service-impl/src/main/java/de/adorsys/webank/bank/api/service/impl/BankAccountCertificateCreationServiceImpl.java index fb79d45..510ea7a 100644 --- a/webank-bank-account/webank-bank-account-service-impl/src/main/java/de/adorsys/webank/bank/api/service/impl/BankAccountCertificateCreationServiceImpl.java +++ b/webank-bank-account/webank-bank-account-service-impl/src/main/java/de/adorsys/webank/bank/api/service/impl/BankAccountCertificateCreationServiceImpl.java @@ -10,7 +10,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.nio.charset.StandardCharsets; @@ -45,12 +44,12 @@ public String registerNewBankAccount(String phoneNumber, String devicePublicKey, public String generateBankAccountCertificate(String phoneNumber, String devicePublicKey, String accountId) { try { //@Value("${server.private.key}") - String SERVER_PRIVATE_KEY_JSON = "{ \"kty\": \"EC\", \"crv\": \"P-256\", \"d\": \"E-_KxQl0ow6_4Munq81OH_lg64R2vDpe3zq9XnI0AjE\", \"x\": \"PHlAcVDiqi7130xWiMn5CEbOyg_Yo0qfOhabhPlDV_s\", \"y\": \"N5bqvbDjbsX2uo2_lzKrwPt7fySMweZVeFSAv99TEEc\" }"; + String serverPrivateKeyJson = "{ \"kty\": \"EC\", \"crv\": \"P-256\", \"d\": \"E-_KxQl0ow6_4Munq81OH_lg64R2vDpe3zq9XnI0AjE\", \"x\": \"PHlAcVDiqi7130xWiMn5CEbOyg_Yo0qfOhabhPlDV_s\", \"y\": \"N5bqvbDjbsX2uo2_lzKrwPt7fySMweZVeFSAv99TEEc\" }"; //@Value("${server.public.key}") - String SERVER_PUBLIC_KEY_JSON = "{ \"kty\": \"EC\", \"crv\": \"P-256\", \"x\": \"PHlAcVDiqi7130xWiMn5CEbOyg_Yo0qfOhabhPlDV_s\", \"y\": \"N5bqvbDjbsX2uo2_lzKrwPt7fySMweZVeFSAv99TEEc\" }"; + String serverPublicKeyJson = "{ \"kty\": \"EC\", \"crv\": \"P-256\", \"x\": \"PHlAcVDiqi7130xWiMn5CEbOyg_Yo0qfOhabhPlDV_s\", \"y\": \"N5bqvbDjbsX2uo2_lzKrwPt7fySMweZVeFSAv99TEEc\" }"; // Parse the server's private key from the JWK JSON string - ECKey serverPrivateKey = (ECKey) JWK.parse(SERVER_PRIVATE_KEY_JSON); + ECKey serverPrivateKey = (ECKey) JWK.parse(serverPrivateKeyJson); // Check that the private key contains the 'd' (private) parameter for signing if (serverPrivateKey.getD() == null) { @@ -77,7 +76,7 @@ public String generateBankAccountCertificate(String phoneNumber, String devicePu Payload payload = new Payload(payloadData); // Parse the server's public key from the JWK JSON string - ECKey serverPublicKey = (ECKey) JWK.parse(SERVER_PUBLIC_KEY_JSON); + ECKey serverPublicKey = (ECKey) JWK.parse(serverPublicKeyJson); // Create the JWT header with the JWK object (the server public key) JWSHeader header = new JWSHeader.Builder(JWSAlgorithm.ES256)