### Question:
PemUtils { public static Object fromPemString(String pemStr) throws PemException { byte[] pemBytes; Object obj; if (pemStr == null) { throw new NotAPemObject("String parameter in call to PemUtils.fromPemString(String pem) was null"); } try { pemBytes = pemStr.getBytes(RsaConst.USASCII); obj = fromPemBytes(pemBytes); return obj; } catch (UnsupportedEncodingException ex) { throw new PemException("Error decoding PEM", ex); } }  static byte[] toPemBytes(Object obj); static String toPemString(Object obj); static Object fromPemBytes(byte[] pemBytes); static Object fromPemString(String pemStr); static String toMultiPemString(List<? extends Object> objList); static byte[] toMultiPem(List<? extends Object> objList); static List<PemBlock> parseMultiPem(String multiPemString); static List<PemBlock> parseMultiPem(byte[] multiPemBytes); static List<Object> getBlockObjects(List<PemBlock> blocks); static void writeLine(ByteArrayOutputStream bos, byte[] line); static boolean isBegPemBlock(byte[] line); static boolean isEndPemBlock(byte[] line); static boolean isEmptyLine(byte[] line); public JcaPEMWriter ass; static final byte[] BEG_PRV; static final byte[] END_PRV; static final byte[] BEG_CSR; static final byte[] END_CSR; static final byte[] BEG_CRT; static final byte[] END_CRT; static final byte[] BEG_RSA; static final byte[] END_RSA; static final byte[][] BEG_LINES; static final byte[][] END_LINES; }### Answer:
@Test public void testDecodeString() throws PemException{ Object obj; obj = PemUtils.fromPemString(TEST_CSR); Assert.assertTrue(obj instanceof PKCS10CertificationRequest); obj = PemUtils.fromPemString(TEST_RSA_PKCS1); Assert.assertTrue(obj instanceof KeyPair); obj = PemUtils.fromPemString(TEST_RSA_PKCS8); obj = PemUtils.fromPemString(TEST_X509); System.out.printf(String.format("%s", obj.getClass().getCanonicalName())); }