### Question:
JCECrypto implements Crypto { public static RSAPrivateKey getRSAPrivateKeyFromPEM(Provider provider, String pem) { try { KeyFactory keyFactory = KeyFactory.getInstance("RSA", provider); return (RSAPrivateKey) keyFactory.generatePrivate(new PKCS8EncodedKeySpec(getKeyBytesFromPEM(pem))); } catch (NoSuchAlgorithmException e) { throw new IllegalArgumentException("Algorithm SHA256withRSA is not available", e); } catch (InvalidKeySpecException e) { throw new IllegalArgumentException("Invalid PEM provided", e); } } JCECrypto(Provider provider); @Override byte[] encryptRSA(byte[] message, PublicKey publicKey); @Override byte[] decryptRSA(byte[] message, PrivateKey privateKey); @Override RSAPublicKey getRSAPublicKeyFromPEM(String publicKey); @Override byte[] sha256(byte[] input); @Override byte[] sha384(byte[] input); @Override byte[] sha512(byte[] input); @Override String getRsaPublicKeyFingerprint(RSAPublicKey key); @Override String getRsaPublicKeyFingerprint(RSAPrivateKey key); static RSAPrivateKey getRSAPrivateKeyFromPEM(Provider provider, String pem); static RSAPublicKey getRSAPublicKeyFromPEM(Provider provider, String pem); static String getRsaPublicKeyFingerprint(Provider provider, RSAPrivateKey key); static String getRsaPublicKeyFingerprint(Provider provider, RSAPublicKey key); static String getPEMFromRSAPublicKey(RSAPublicKey publicKey); static String getPEMFromRSAPrivateKey(RSAPrivateKey privateKey);  }### Answer:
@Test public void testGetRSAPrivateKeyFromPEM() throws Exception { RSAPrivateKey actual = JCECrypto.getRSAPrivateKeyFromPEM(provider, PRIVATE_KEY); assertNotNull(actual); }
@Test public void testGetRSAPrivateKeyFromPEMCarriageReturn() throws Exception { RSAPrivateKey actual = JCECrypto.getRSAPrivateKeyFromPEM(provider, PRIVATE_KEY_CARRIAGE_RETURN); assertNotNull(actual); }
@Test public void testGetRSAPrivateKeyFromPEMCarriageReturnNewline() throws Exception { RSAPrivateKey actual = JCECrypto.getRSAPrivateKeyFromPEM(provider, PRIVATE_KEY_CARRIAGE_RETURN_NEWLINE); assertNotNull(actual); }