Package dev.galasa.zossecurity
Class KerberosInitiator
java.lang.Object
dev.galasa.zossecurity.KerberosInitiator
This class represents the initiator of the kerberos security context. It is
created with a service, a client and a kdc. Requested properties, such as
mutual authentication and confidentiality can then be set before calling
create()
to create the security context. initiate()
will
then be called, (and potentially initiate(KerberosToken)
if further
initiation is required).-
Constructor Summary
ConstructorsConstructorDescriptionKerberosInitiator
(IZosKerberosPrincipal service, IZosKerberosPrincipal client, String kdc) Construct with service client and kdc -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Create the security context by logging into the KDC as the client and populating the context from the subjectvoid
dispose()
Dispose of the underlying security context, releasing any associated resources.void
finalize()
initiate()
Initiate the security context without a token.initiate
(KerberosToken inToken) Initiate the security context with a token, or without if inToken is null.boolean
Return true when the security context has been establishedboolean
Returns true if confidentiality has been requestedboolean
Returns true if credential delegation has been requestedboolean
Returns true if mutual authentication has been requestedvoid
setRequestConf
(boolean requestConf) Set true to request confidentialityvoid
setRequestCredDeleg
(boolean requestCredDeleg) Set true to request credential delegationvoid
setRequestMutualAuth
(boolean requestMutualAuth) Set true to request mutual authenticationbyte[]
unwrap
(byte[] wrappedMessage) This method will use the context to unwrap a message wrapped on the other side of the contextThis method accepts and returns base64 encoded messages.
-
Constructor Details
-
KerberosInitiator
Construct with service client and kdc- Parameters:
service
-client
-kdc
-
-
-
Method Details
-
isRequestMutualAuth
public boolean isRequestMutualAuth()Returns true if mutual authentication has been requested- Returns:
- - true if mutual authentication has been requested
-
setRequestMutualAuth
public void setRequestMutualAuth(boolean requestMutualAuth) Set true to request mutual authentication- Parameters:
requestMutualAuth
-
-
isRequestConf
public boolean isRequestConf()Returns true if confidentiality has been requested- Returns:
- - true if confidentiality has been requested
-
setRequestConf
public void setRequestConf(boolean requestConf) Set true to request confidentiality- Parameters:
requestConf
-
-
isRequestCredDeleg
public boolean isRequestCredDeleg()Returns true if credential delegation has been requested- Returns:
- - true if credential delegation has been requested
-
setRequestCredDeleg
public void setRequestCredDeleg(boolean requestCredDeleg) Set true to request credential delegation- Parameters:
requestCredDeleg
-
-
isContextEstablished
public boolean isContextEstablished()Return true when the security context has been established- Returns:
- - true when the security context has been established
-
create
Create the security context by logging into the KDC as the client and populating the context from the subject- Throws:
ZosSecurityManagerException
-
initiate
Initiate the security context without a token. This is equivalent toinitiate(KerberosToken)
where the token is null, and is always the first called during initiation- Returns:
- - a Kerberos token
- Throws:
ZosSecurityManagerException
-
initiate
Initiate the security context with a token, or without if inToken is null. Initiate will always first be called without a token, and may be called with a token if the acceptor produces further tokens when accepting the security context.isContextEstablished()
can be called to determine whether further tokens are likely to be required to establish the context.- Parameters:
inToken
-- Returns:
- - a Kerberos token
- Throws:
ZosSecurityManagerException
-
unwrap
This method accepts and returns base64 encoded messages. It will decode the input, callunwrap(byte[])
, encode the result and return it.- Parameters:
base64EncodedWrappedMessage
-- Returns:
- - decoded string
- Throws:
ZosSecurityManagerException
-
unwrap
This method will use the context to unwrap a message wrapped on the other side of the context- Parameters:
wrappedMessage
-- Returns:
- - decoded bytes
- Throws:
ZosSecurityManagerException
-
dispose
public void dispose()Dispose of the underlying security context, releasing any associated resources. -
finalize
public void finalize()
-