static PrivateKey loadPrivateKey(String keyPath) throws IOException, GeneralSecurityException {
        try (Reader reader = new FileReader(keyPath);
            PEMParser parser = new PEMParser(reader)) {
            Object readObject;
            while ((readObject = parser.readObject()) != null) {
                if (readObject instanceof PEMKeyPair) {
                    PEMKeyPair keyPair = (PEMKeyPair) readObject;
                    return generatePrivateKey(keyPair.getPrivateKeyInfo());
                } else if (readObject instanceof PrivateKeyInfo) {
                    return generatePrivateKey((PrivateKeyInfo) readObject);
                }
            }
        }
        throw new GeneralSecurityException("Cannot generate private key from file: " + keyPath);
    }
Create a key stored holding certificates and secret keys from the given Docker key cert

@param certPath directory holding the keys (key.pem) and certs (ca.pem, cert.pem)
@return a keystore where the private key is secured with "docker"

@throws IOException is reading of the the PEMs failed
@throws GeneralSecurityException when the files in a wrong format
src/main/java/io/fabric8/maven/docker/access/KeyStoreUtil.java