private HashMap < String , JSONObject > buildKeyMap ( String content ) throws ConnectionException { HashMap < String , JSONObject > retMap = new HashMap < String , JSONObject > ( ) ; JSONObject jwksPayload = new JSONObject ( content ) ; JSONArray keysArray = jwksPayload . getJSONArray ( "keys" ) ; for ( int i = 0 ; i < keysArray . length ( ) ; i ++ ) { JSONObject object = keysArray . getJSONObject ( i ) ; String keyId = object . getString ( "kid" ) ; retMap . put ( keyId , object ) ; } return retMap ; }
Build Map from response