public PrivateKey convertPrivateKey(final String privatePemKey) {

        StringReader keyReader = new StringReader(privatePemKey);
        try {
            PrivateKeyInfo privateKeyInfo = PrivateKeyInfo
                    .getInstance(new PEMParser(keyReader).readObject());
            return new JcaPEMKeyConverter().getPrivateKey(privateKeyInfo);
        } catch (IOException exception) {
            throw new RuntimeException(exception);
        }

    }
@Test
    void givenEmptyPrivateKey_whenConvertPrivateKey_thenThrowRuntimeException() {
        // Given
        String emptyPrivatePemKey = "";

        // When & Then
        assertThatThrownBy(() -> KeyConverter.convertPrivateKey(emptyPrivatePemKey))
                .isInstanceOf(RuntimeException.class)
                .hasCauseInstanceOf(PEMException.class)
                .hasMessageContaining("PEMException");
    }