@Test
public void canReadPrivateKeyWithPassword() throws IOException {

    // given
    Security.addProvider(new BouncyCastleProvider());
    KeyReader keyReader = new KeyReader();
    FileInputStream pemPKey = new FileInputStream(PEMCertInfoTest.TEST_KEY_PATH_WITH_PASSPHRASE);
    // when
    PKCS8EncodedKeySpec keySpec = keyReader.readPrivateKey(pemPKey,
            Optional.ofNullable(PEMCertInfoTest.TEST_KEY_PASSPHRASE)
    );
    // then
    Assert.assertNotNull(keySpec);
}