Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!
openssl genrsa -des3 -out rootCA.key 4096
import java.io.IOException; | |
import java.io.OutputStream; | |
/** | |
* <p> | |
* MultiplexOutputStream allows you to write to multiple output streams "at once". | |
* It allows you to use one outputstream writer to write to multiple outputstreams | |
* without repeating yourself. | |
* Based off <a href="https://github.com/creditdatamw/kapenta/blob/master/src/main/java/com/creditdatamw/labs/kapenta/io/MultiplexOutputStream.java">MultiplexOutputStream.java</a> | |
*/ |
public final class MimeTypes | |
{ | |
public static final class Application | |
{ | |
public static final String ATOM_XML = "application/atom+xml"; | |
public static final String ATOMCAT_XML = "application/atomcat+xml"; | |
public static final String ECMASCRIPT = "application/ecmascript"; | |
public static final String JAVA_ARCHIVE = "application/java-archive"; | |
public static final String JAVASCRIPT = "application/javascript"; | |
public static final String JSON = "application/json"; |
/** | |
* Utility class to read encrypted PEM files and generate a | |
* SSL Socket Factory based on the provided certificates. | |
* The original code is by Sharon Asher (link below). I have modified | |
* it to use a newer version of the BouncyCastle Library (v1.52) | |
* | |
* Reference - https://gist.github.com/sharonbn/4104301" | |
*/ | |
import org.bouncycastle.cert.X509CertificateHolder; |
import java.io.*; | |
import java.nio.file.*; | |
import java.security.*; | |
import java.security.cert.*; | |
import javax.net.ssl.*; | |
import org.bouncycastle.jce.provider.*; | |
import org.bouncycastle.openssl.*; | |
public class SslUtil |