keycloak
クラス | 静的公開メンバ関数 | 静的公開変数類 | 静的関数 | 非公開メンバ関数 | 静的非公開メンバ関数 | 全メンバ一覧
org.keycloak.common.util.KerberosSerializationUtils クラス
org.keycloak.common.util.KerberosSerializationUtils 連携図
Collaboration graph

クラス

class  KerberosSerializationException
 

静的公開メンバ関数

static String serializeCredential (KerberosTicket kerberosTicket, GSSCredential gssCredential) throws KerberosSerializationException
 
static GSSCredential deserializeCredential (String serializedCred) throws KerberosSerializationException
 

静的公開変数類

static final String JAVA_INFO
 

静的関数

 [static initializer]
 

非公開メンバ関数

 KerberosSerializationUtils ()
 

静的非公開メンバ関数

static String serialize (Serializable obj) throws IOException
 
static Object deserialize (String serialized) throws ClassNotFoundException, IOException
 

詳解

Provides serialization/deserialization of kerberos org.ietf.jgss.GSSCredential, so it can be transmitted from auth-server to the application and used for further calls to kerberos-secured services

著者
Marek Posolda

構築子と解体子

◆ KerberosSerializationUtils()

org.keycloak.common.util.KerberosSerializationUtils.KerberosSerializationUtils ( )
inlineprivate
50  {
51  }

関数詳解

◆ [static initializer]()

org.keycloak.common.util.KerberosSerializationUtils.[static initializer] ( )
inlinestaticpackage

◆ deserialize()

static Object org.keycloak.common.util.KerberosSerializationUtils.deserialize ( String  serialized) throws ClassNotFoundException, IOException
inlinestaticprivate
109  {
110  byte[] bytes = Base64.decode(serialized);
111  ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
112  ObjectInput in = null;
113  try {
114  in = new ObjectInputStream(bis);
115  return in.readObject();
116  } finally {
117  try {
118  if (in != null) {
119  in.close();
120  }
121  } catch (IOException ex) {
122  ex.printStackTrace();
123  }
124  }
125  }

◆ deserializeCredential()

static GSSCredential org.keycloak.common.util.KerberosSerializationUtils.deserializeCredential ( String  serializedCred) throws KerberosSerializationException
inlinestatic
68  {
69  if (serializedCred == null) {
70  throw new KerberosSerializationException("Null credential given as input. Did you enable kerberos credential delegation for your web browser and mapping of gss credential to access token?");
71  }
72 
73  try {
74  Object deserializedCred = deserialize(serializedCred);
75  if (!(deserializedCred instanceof KerberosTicket)) {
76  throw new KerberosSerializationException("Deserialized object is not KerberosTicket! Type is: " + deserializedCred);
77  }
78 
79  KerberosTicket ticket = (KerberosTicket) deserializedCred;
80 
81  return KerberosJdkProvider.getProvider().kerberosTicketToGSSCredential(ticket);
82  } catch (KerberosSerializationException ke) {
83  throw ke;
84  } catch (Exception ioe) {
85  throw new KerberosSerializationException("Unexpected exception when deserialize GSSCredential", ioe);
86  }
87  }
static Object deserialize(String serialized)
Definition: KerberosSerializationUtils.java:109

◆ serialize()

static String org.keycloak.common.util.KerberosSerializationUtils.serialize ( Serializable  obj) throws IOException
inlinestaticprivate
90  {
91  ByteArrayOutputStream bos = new ByteArrayOutputStream();
92  ObjectOutput out = null;
93  try {
94  out = new ObjectOutputStream(bos);
95  out.writeObject(obj);
96  byte[] objBytes = bos.toByteArray();
97  return Base64.encodeBytes(objBytes);
98  } finally {
99  try {
100  if (out != null) {
101  out.close();
102  }
103  } catch (IOException ex) {
104  ex.printStackTrace();
105  }
106  }
107  }

◆ serializeCredential()

static String org.keycloak.common.util.KerberosSerializationUtils.serializeCredential ( KerberosTicket  kerberosTicket,
GSSCredential  gssCredential 
) throws KerberosSerializationException
inlinestatic
53  {
54  try {
55  if (gssCredential == null) {
56  throw new KerberosSerializationException("Null credential given as input");
57  }
58 
59  kerberosTicket = KerberosJdkProvider.getProvider().gssCredentialToKerberosTicket(kerberosTicket, gssCredential);
60 
61  return serialize(kerberosTicket);
62  } catch (IOException e) {
63  throw new KerberosSerializationException("Unexpected exception when serialize GSSCredential", e);
64  }
65  }
static String serialize(Serializable obj)
Definition: KerberosSerializationUtils.java:90

メンバ詳解

◆ JAVA_INFO

final String org.keycloak.common.util.KerberosSerializationUtils.JAVA_INFO
static

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