gluu
公開メンバ関数 | 静的公開メンバ関数 | 全メンバ一覧
org.xdi.oxauth.model.config.WebKeysConfiguration クラス
org.xdi.oxauth.model.config.WebKeysConfiguration の継承関係図
Inheritance graph
org.xdi.oxauth.model.config.WebKeysConfiguration 連携図
Collaboration graph

公開メンバ関数

List< JSONWebKey > getKeys ()
 
List< JSONWebKey > getKeys (SignatureAlgorithm algorithm)
 
void setKeys (List< JSONWebKey > keys)
 
JSONWebKey getKey (String keyId)
 
JSONObject toJSONObject () throws JSONException
 
String toString ()
 

静的公開メンバ関数

static JSONWebKeySet fromJSONObject (JSONObject jwksJSONObject) throws JSONException
 

詳解

著者
Yuriy Movchan
バージョン
03/15/2017

関数詳解

◆ fromJSONObject()

static JSONWebKeySet org.xdi.oxauth.model.jwk.JSONWebKeySet.fromJSONObject ( JSONObject  jwksJSONObject) throws JSONException
inlinestaticinherited
101  {
102  JSONWebKeySet jwks = new JSONWebKeySet();
103 
104  JSONArray jwksJsonArray = jwksJSONObject.getJSONArray(JSON_WEB_KEY_SET);
105  for (int i = 0; i < jwksJsonArray.length(); i++) {
106  JSONObject jwkJsonObject = jwksJsonArray.getJSONObject(i);
107 
108  JSONWebKey jwk = JSONWebKey.fromJSONObject(jwkJsonObject);
109  jwks.getKeys().add(jwk);
110  }
111 
112  return jwks;
113  }
JSONWebKeySet()
Definition: JSONWebKeySet.java:32

◆ getKey()

JSONWebKey org.xdi.oxauth.model.jwk.JSONWebKeySet.getKey ( String  keyId)
inlineinherited
44  {
45  for (JSONWebKey jsonWebKey : keys) {
46  if (jsonWebKey.getKid().equals(keyId)) {
47  return jsonWebKey;
48  }
49  }
50 
51  return null;
52  }
List< JSONWebKey > keys
Definition: JSONWebKeySet.java:30

◆ getKeys() [1/2]

List<JSONWebKey> org.xdi.oxauth.model.jwk.JSONWebKeySet.getKeys ( )
inlineinherited
36  {
37  return keys;
38  }
List< JSONWebKey > keys
Definition: JSONWebKeySet.java:30

◆ getKeys() [2/2]

List<JSONWebKey> org.xdi.oxauth.model.jwk.JSONWebKeySet.getKeys ( SignatureAlgorithm  algorithm)
inlineinherited
55  {
56  List<JSONWebKey> jsonWebKeys = new ArrayList<JSONWebKey>();
57 
58  if (SignatureAlgorithmFamily.RSA.equals(algorithm.getFamily())) {
59  for (JSONWebKey jsonWebKey : keys) {
60  if (jsonWebKey.getAlg().equals(algorithm.getName())) {
61  jsonWebKeys.add(jsonWebKey);
62  }
63  }
64  } else if (SignatureAlgorithmFamily.EC.equals(algorithm.getFamily())) {
65  for (JSONWebKey jsonWebKey : keys) {
66  if (jsonWebKey.getAlg().equals(algorithm.getName())) {
67  jsonWebKeys.add(jsonWebKey);
68  }
69  }
70  }
71 
72  Collections.sort(jsonWebKeys);
73  return jsonWebKeys;
74  }
List< JSONWebKey > keys
Definition: JSONWebKeySet.java:30

◆ setKeys()

void org.xdi.oxauth.model.jwk.JSONWebKeySet.setKeys ( List< JSONWebKey keys)
inlineinherited
40  {
41  this.keys = keys;
42  }
List< JSONWebKey > keys
Definition: JSONWebKeySet.java:30

◆ toJSONObject()

JSONObject org.xdi.oxauth.model.jwk.JSONWebKeySet.toJSONObject ( ) throws JSONException
inlineinherited
76  {
77  JSONObject jsonObj = new JSONObject();
78  JSONArray keys = new JSONArray();
79 
80  for (JSONWebKey key : getKeys()) {
81  JSONObject jsonKeyValue = key.toJSONObject();
82 
83  keys.put(jsonKeyValue);
84  }
85 
86  jsonObj.put(JSON_WEB_KEY_SET, keys);
87  return jsonObj;
88  }
List< JSONWebKey > keys
Definition: JSONWebKeySet.java:30
List< JSONWebKey > getKeys()
Definition: JSONWebKeySet.java:36

◆ toString()

String org.xdi.oxauth.model.jwk.JSONWebKeySet.toString ( )
inlineinherited
91  {
92  try {
93  JSONObject jwks = toJSONObject();
94  return jwks.toString(4).replace("\\/", "/");
95  } catch (JSONException e) {
96  LOG.error(e.getMessage(), e);
97  return null;
98  }
99  }
static final Logger LOG
Definition: JSONWebKeySet.java:28
JSONObject toJSONObject()
Definition: JSONWebKeySet.java:76

このクラス詳解は次のファイルから抽出されました: