Skip to content

Commit

Permalink
update some bug pem file
Browse files Browse the repository at this point in the history
  • Loading branch information
rmtomal00 committed May 7, 2024
1 parent dc36f62 commit 7350cab
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM openjdk:17-jdk-alpine
ARG JAR_FILE=target/*.jar
COPY ./target/Nagad-Payment-0.0.1-SNAPSHOT.jar Nagad_payment.jar
ENTRYPOINT ["java","-jar", "Nagad_payment.jar"]
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,27 @@
import jakarta.xml.bind.DatatypeConverter;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;

import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.security.*;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.Base64;


public class CryptoCommon {
private final String privateKey = "src/main/java/com/tomal/Nagad/Payment/CryptoUtility/marchent_private.pem";
private final String publicKey = "src/main/java/com/tomal/Nagad/Payment/CryptoUtility/marchent_public.pem";


//InputStream inputStream = getClass().getResourceAsStream("/marchent_private.pem");
//InputStream publicKey = getClass().getResourceAsStream("/marchent_public.pem");

public byte[] sign(PrivateKey merchantPrivateKey, byte[] bytes) {
Object var4 = null;
Expand Down Expand Up @@ -58,7 +63,9 @@ public String generateRandomString(int size, byte[] seed) {
}

public PublicKey getPublic() throws Exception {
BufferedReader reader = new BufferedReader(new FileReader(publicKey));
ClassPathResource resource = new ClassPathResource("marchent_public.pem");
InputStream inputStream = resource.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
String content = reader.readLine();
System.out.println(content);

Expand All @@ -71,7 +78,9 @@ public PublicKey getPublic() throws Exception {
}

public PrivateKey getPrivate() throws Exception {
BufferedReader reader = new BufferedReader(new FileReader(privateKey));
ClassPathResource resource = new ClassPathResource("marchent_private.pem");
InputStream inputStream = resource.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
String content = reader.readLine();
System.out.println(content);

Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 7350cab

Please sign in to comment.