From 92df3bb4a7b4dafcdcc35440f3c01832caf23de8 Mon Sep 17 00:00:00 2001 From: Martin Paljak Date: Tue, 12 Apr 2016 11:44:20 +0300 Subject: [PATCH] Simplify PEM writing --- src/org/esteid/hacker/CLI.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/org/esteid/hacker/CLI.java b/src/org/esteid/hacker/CLI.java index 9313a0d..e24a0ff 100644 --- a/src/org/esteid/hacker/CLI.java +++ b/src/org/esteid/hacker/CLI.java @@ -22,7 +22,6 @@ import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; -import java.io.OutputStreamWriter; import java.net.URL; import java.net.URLClassLoader; import java.nio.charset.Charset; @@ -46,7 +45,6 @@ import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.bouncycastle.openssl.PEMParser; -import org.bouncycastle.openssl.jcajce.JcaPEMWriter; import apdu4j.HexUtils; import apdu4j.LoggingCardTerminal; @@ -263,12 +261,9 @@ public static void main(String argv[]) throws Exception { pem.close(); X509Certificate newcert = ca.cloneUserCertificate((RSAPublicKey) crt.getPublicKey(), crt); - JcaPEMWriter wr = new JcaPEMWriter(new OutputStreamWriter(System.out)); - wr.writeObject(newcert); - wr.close(); + System.out.println(crt2pem(newcert)); } - Card card = null; CardTerminal term;