private GigiConfig() {
}
+
public byte[] getCacerts() {
return cacerts;
}
+
public byte[] getKeystore() {
return keystore;
}
+
public Properties getMainProps() {
return mainProps;
}
tis.close();
return gc;
}
+
public static byte[] readFully(InputStream is) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
baos.close();
return baos.toByteArray();
}
+
private static char[] transformSafe(byte[] readChunk) {
char[] res = new char[readChunk.length];
for (int i = 0; i < res.length; i++) {
return res;
}
- public KeyStore getPrivateStore() throws GeneralSecurityException,
- IOException {
+ public KeyStore getPrivateStore() throws GeneralSecurityException, IOException {
KeyStore ks1 = KeyStore.getInstance("pkcs12");
ks1.load(new ByteArrayInputStream(keystore), keystorpw);
return ks1;
}
- public KeyStore getTrustStore() throws GeneralSecurityException,
- IOException {
+
+ public KeyStore getTrustStore() throws GeneralSecurityException, IOException {
KeyStore ks1 = KeyStore.getInstance("jks");
ks1.load(new ByteArrayInputStream(cacerts), truststorepw);
return ks1;
}
+
+ public String getPrivateStorePw() {
+ return new String(keystorpw);
+ }
}