@Nonnull
    @Override
    protected PrivateKey createInstance() {
        var key = readPemPrivateKey();
        if (key == null) {
            LOGGER.debug("Key [{}] is not in PEM format. Trying next...", this.location);
            key = readDERPrivateKey();
        }
        return key;
    }
Factory Bean for creating a private key from a file.

@author Scott Battaglia
@since 3.1
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/crypto/PrivateKeyFactoryBean.java