For excessively paranoid client authentication.
Organization & Common Name: Some human identifier for this server CA.
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
//Get file from resources folder | |
ClassLoader classLoader = getClass().getClassLoader(); | |
File file = new File(classLoader.getResource("certs/root/ca-key.pkcs8").getFile()); | |
return readPrivateKey(file.getPath()); |
For excessively paranoid client authentication.
Organization & Common Name: Some human identifier for this server CA.
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
/** | |
* Extract the issuer cert's URI from cert. | |
* @param var0 | |
* @return | |
*/ | |
private URI getIssuerCertURL(X509CertImpl var0) { | |
AuthorityInfoAccessExtension var1 = var0.getAuthorityInfoAccessExtension(); | |
if(var1 == null) { | |
return null; | |
} else { |
RandomAccessFile raf = new RandomAccessFile("certs/client/client.cer.pem", "r"); | |
byte[] buf = new byte[(int) raf.length()]; | |
raf.readFully(buf); | |
raf.close(); |
/** | |
* Read PEM certificate into javax.security.x509Certificate. | |
* @param certText | |
* @return | |
*/ | |
private X509Certificate readPemCert(String certText) { | |
CertificateFactory certificateFactory = null; | |
try { | |
certificateFactory = CertificateFactory.getInstance("X.509"); |
public static boolean available(int port) { | |
if (port < MIN_PORT_NUMBER || port > MAX_PORT_NUMBER) { | |
throw new IllegalArgumentException("Invalid start port: " + port); | |
} | |
ServerSocket ss = null; | |
DatagramSocket ds = null; | |
try { | |
ss = new ServerSocket(port); | |
ss.setReuseAddress(true); |