private static void writePemFile(PrivateKey key, String label, String outputPath) 
            throws IOException {
        writePemFile(key.getEncoded(), label, outputPath);
    }
Overload for PrivateKey objects; calls getEncoded() and writes to PEM.
integration/logstash-plugins/logstash-output-vespa/src/main/java/org/logstashplugins/SelfSignedCertGenerator.java