question: public RSAPublicKey parsePEMPublicKey ( String pem ) throws GeneralSecurityException { try { byte [ ] bs = decodeAsciiArmoredPEM ( pem ) ; ByteBuffer data = ByteBuffer . wrap ( bs ) ; final ASN1Object ob = asn1Parser . parseASN1 ( data ) ; final List < ASN1Object > seq = asn1ObjectToSequence ( ob , 2 ) ; final BigInteger modulus = asn1ObjectToBigInt ( seq . get ( 0 ) ) ; final BigInteger exponent = asn1ObjectToBigInt ( seq . get ( 1 ) ) ; return createKeyFromModulusAndExponent ( modulus , exponent ) ; } catch ( IllegalArgumentException e ) { throw new InvalidKeyException ( ) ; } }
target:  Parse a PKCS1 PEM encoded RSA public key into the modulus/exponent components and construct a new RSAPublicKey