### Question:
PubkeyUtils { static BigInteger getRSAPublicExponentFromPkcs8Encoded(byte[] encoded) throws InvalidKeySpecException { if (encoded == null) { throw new InvalidKeySpecException("encoded key is null"); } try { SimpleDERReader reader = new SimpleDERReader(encoded); reader.resetInput(reader.readSequenceAsByteArray()); if (!reader.readInt().equals(BigInteger.ZERO)) { throw new InvalidKeySpecException("PKCS#8 is not version 0"); } reader.readSequenceAsByteArray(); reader.resetInput(reader.readOctetString()); reader.resetInput(reader.readSequenceAsByteArray()); if (!reader.readInt().equals(BigInteger.ZERO)) { throw new InvalidKeySpecException("RSA key is not version 0"); } reader.readInt(); return reader.readInt(); } catch (IOException e) { Log.w(TAG, "Could not read public exponent", e); throw new InvalidKeySpecException("Could not read key", e); } } private  PubkeyUtils(); static String formatKey(Key key); static byte[] getEncodedPrivate(PrivateKey pk, String secret); static PrivateKey decodePrivate(byte[] encoded, String keyType); static PrivateKey decodePrivate(byte[] encoded, String keyType, String secret); static int getBitStrength(byte[] encoded, String keyType); static PublicKey decodePublic(byte[] encoded, String keyType); static KeyPair convertToKeyPair(PubkeyBean keybean, String password); static KeyPair recoverKeyPair(byte[] encoded); static String convertToOpenSSHFormat(PublicKey pk, String origNickname); static byte[] extractOpenSSHPublic(KeyPair pair); static String exportPEM(PrivateKey key, String secret); static final String PKCS8_START; static final String PKCS8_END; }### Answer:
@Test public void getRSAPublicExponentFromPkcs8Encoded_Success() throws Exception { assertEquals(RSA_KEY_E, PubkeyUtils.getRSAPublicExponentFromPkcs8Encoded(RSA_KEY_PKCS8)); }