Skip to content

Commit

Permalink
fixed quality gate
Browse files Browse the repository at this point in the history
  • Loading branch information
Koufan-De-King committed Jan 31, 2025
1 parent dd50e6f commit 9f2beba
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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)
Expand Down

0 comments on commit 9f2beba

Please sign in to comment.