private Optional<KeyManager[]> createKeyManagers(KeyStore keystore) throws GeneralSecurityException {
        if (!hasCertificateInstance() && !hasCertificateFile()) return Optional.empty();
        KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
        kmf.init(keystore, new char[0]);
        return Optional.of(kmf.getKeyManagers());
    }
BouncyCastle integration for creating a {@link SSLContext} instance from PEM encoded material

@author bjorncs
vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/SslContextBuilder.java