|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsun.security.mule.jgss.GSSContextImpl
public class GSSContextImpl
This class represents the JGSS security context and its associated operations. JGSS security contexts are established between peers using locally established credentials. Multiple contexts may exist simultaneously between a pair of peers, using the same or different set of credentials. The JGSS is independent of the underlying transport protocols and depends on its callers to transport the tokens between peers.
The context object can be thought of as having 3 implicit states: before it is established, during its context establishment, and after a fully established context exists.
Before the context establishment phase is initiated, the context initiator may request specific characteristics desired of the established context. These can be set using the set methods. After the context is established, the caller can check the actual characteristic and services offered by the context using the query methods.
The context establishment phase begins with the first call to the initSecContext method by the context initiator. During this phase the initSecContext and acceptSecContext methods will produce GSS-API authentication tokens which the calling application needs to send to its peer. The initSecContext and acceptSecContext methods may return a CONTINUE_NEEDED code which indicates that a token is needed from its peer in order to continue the context establishment phase. A return code of COMPLETE signals that the local end of the context is established. This may still require that a token be sent to the peer, depending if one is produced by GSS-API. The isEstablished method can also be used to determine if the local end of the context has been fully established. During the context establishment phase, the isProtReady method may be called to determine if the context can be used for the per-message operations. This allows implementation to use per-message operations on contexts which aren't fully established.
After the context has been established or the isProtReady method returns "true", the query routines can be invoked to determine the actual characteristics and services of the established context. The application can also start using the per-message methods of wrap and getMIC to obtain cryptographic operations on application supplied data.
When the context is no longer needed, the application should call dispose to release any system resources the context may be using.
| Field Summary |
|---|
| Fields inherited from interface org.ietf.jgss.GSSContext |
|---|
DEFAULT_LIFETIME, INDEFINITE_LIFETIME |
| Constructor Summary | |
|---|---|
GSSContextImpl(GSSManagerImpl gssManager,
byte[] interProcessToken)
Creates a GSSContextImpl out of a previously exported GSSContext. |
|
GSSContextImpl(GSSManagerImpl gssManager,
GSSCredential myCred)
Creates a GSSContextImpl on the context acceptor's side. |
|
GSSContextImpl(GSSManagerImpl gssManager,
GSSName peer,
Oid mech,
GSSCredential myCred,
int lifetime)
Creates a GSSContextImp on the context initiator's side. |
|
| Method Summary | |
|---|---|
byte[] |
acceptSecContext(byte[] inTok,
int offset,
int len)
|
void |
acceptSecContext(InputStream inStream,
OutputStream outStream)
|
void |
dispose()
|
byte[] |
export()
|
boolean |
getAnonymityState()
|
boolean |
getConfState()
|
boolean |
getCredDelegState()
|
GSSCredential |
getDelegCred()
|
boolean |
getIntegState()
|
int |
getLifetime()
|
Oid |
getMech()
|
byte[] |
getMIC(byte[] inMsg,
int offset,
int len,
MessageProp msgProp)
|
void |
getMIC(InputStream inStream,
OutputStream outStream,
MessageProp msgProp)
|
boolean |
getMutualAuthState()
|
boolean |
getReplayDetState()
|
boolean |
getSequenceDetState()
|
GSSName |
getSrcName()
|
GSSName |
getTargName()
|
int |
getWrapSizeLimit(int qop,
boolean confReq,
int maxTokenSize)
|
byte[] |
initSecContext(byte[] inputBuf,
int offset,
int len)
|
int |
initSecContext(InputStream inStream,
OutputStream outStream)
|
boolean |
isEstablished()
|
boolean |
isInitiator()
|
boolean |
isProtReady()
|
boolean |
isTransferable()
|
void |
requestAnonymity(boolean state)
|
void |
requestConf(boolean state)
|
void |
requestCredDeleg(boolean state)
|
void |
requestInteg(boolean state)
|
void |
requestLifetime(int lifetime)
|
void |
requestMutualAuth(boolean state)
|
void |
requestReplayDet(boolean state)
|
void |
requestSequenceDet(boolean state)
|
void |
resetStateToInProgress()
|
void |
setChannelBinding(ChannelBinding channelBindings)
|
byte[] |
unwrap(byte[] inBuf,
int offset,
int len,
MessageProp msgProp)
|
void |
unwrap(InputStream inStream,
OutputStream outStream,
MessageProp msgProp)
|
void |
verifyMIC(byte[] inTok,
int tokOffset,
int tokLen,
byte[] inMsg,
int msgOffset,
int msgLen,
MessageProp msgProp)
|
void |
verifyMIC(InputStream tokStream,
InputStream msgStream,
MessageProp msgProp)
|
byte[] |
wrap(byte[] inBuf,
int offset,
int len,
MessageProp msgProp)
|
void |
wrap(InputStream inStream,
OutputStream outStream,
MessageProp msgProp)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GSSContextImpl(GSSManagerImpl gssManager,
GSSName peer,
Oid mech,
GSSCredential myCred,
int lifetime)
throws GSSException
GSSException
public GSSContextImpl(GSSManagerImpl gssManager,
GSSCredential myCred)
throws GSSException
GSSException
public GSSContextImpl(GSSManagerImpl gssManager,
byte[] interProcessToken)
throws GSSException
GSSExceptionisTransferable()| Method Detail |
|---|
public void resetStateToInProgress()
public byte[] initSecContext(byte[] inputBuf,
int offset,
int len)
throws GSSException
initSecContext in interface GSSContextGSSException
public int initSecContext(InputStream inStream,
OutputStream outStream)
throws GSSException
initSecContext in interface GSSContextGSSException
public byte[] acceptSecContext(byte[] inTok,
int offset,
int len)
throws GSSException
acceptSecContext in interface GSSContextGSSException
public void acceptSecContext(InputStream inStream,
OutputStream outStream)
throws GSSException
acceptSecContext in interface GSSContextGSSExceptionpublic boolean isEstablished()
isEstablished in interface GSSContext
public int getWrapSizeLimit(int qop,
boolean confReq,
int maxTokenSize)
throws GSSException
getWrapSizeLimit in interface GSSContextGSSException
public byte[] wrap(byte[] inBuf,
int offset,
int len,
MessageProp msgProp)
throws GSSException
wrap in interface GSSContextGSSException
public void wrap(InputStream inStream,
OutputStream outStream,
MessageProp msgProp)
throws GSSException
wrap in interface GSSContextGSSException
public byte[] unwrap(byte[] inBuf,
int offset,
int len,
MessageProp msgProp)
throws GSSException
unwrap in interface GSSContextGSSException
public void unwrap(InputStream inStream,
OutputStream outStream,
MessageProp msgProp)
throws GSSException
unwrap in interface GSSContextGSSException
public byte[] getMIC(byte[] inMsg,
int offset,
int len,
MessageProp msgProp)
throws GSSException
getMIC in interface GSSContextGSSException
public void getMIC(InputStream inStream,
OutputStream outStream,
MessageProp msgProp)
throws GSSException
getMIC in interface GSSContextGSSException
public void verifyMIC(byte[] inTok,
int tokOffset,
int tokLen,
byte[] inMsg,
int msgOffset,
int msgLen,
MessageProp msgProp)
throws GSSException
verifyMIC in interface GSSContextGSSException
public void verifyMIC(InputStream tokStream,
InputStream msgStream,
MessageProp msgProp)
throws GSSException
verifyMIC in interface GSSContextGSSException
public byte[] export()
throws GSSException
export in interface GSSContextGSSException
public void requestMutualAuth(boolean state)
throws GSSException
requestMutualAuth in interface GSSContextGSSException
public void requestReplayDet(boolean state)
throws GSSException
requestReplayDet in interface GSSContextGSSException
public void requestSequenceDet(boolean state)
throws GSSException
requestSequenceDet in interface GSSContextGSSException
public void requestCredDeleg(boolean state)
throws GSSException
requestCredDeleg in interface GSSContextGSSException
public void requestAnonymity(boolean state)
throws GSSException
requestAnonymity in interface GSSContextGSSException
public void requestConf(boolean state)
throws GSSException
requestConf in interface GSSContextGSSException
public void requestInteg(boolean state)
throws GSSException
requestInteg in interface GSSContextGSSException
public void requestLifetime(int lifetime)
throws GSSException
requestLifetime in interface GSSContextGSSException
public void setChannelBinding(ChannelBinding channelBindings)
throws GSSException
setChannelBinding in interface GSSContextGSSExceptionpublic boolean getCredDelegState()
getCredDelegState in interface GSSContextpublic boolean getMutualAuthState()
getMutualAuthState in interface GSSContextpublic boolean getReplayDetState()
getReplayDetState in interface GSSContextpublic boolean getSequenceDetState()
getSequenceDetState in interface GSSContextpublic boolean getAnonymityState()
getAnonymityState in interface GSSContext
public boolean isTransferable()
throws GSSException
isTransferable in interface GSSContextGSSExceptionpublic boolean isProtReady()
isProtReady in interface GSSContextpublic boolean getConfState()
getConfState in interface GSSContextpublic boolean getIntegState()
getIntegState in interface GSSContextpublic int getLifetime()
getLifetime in interface GSSContext
public GSSName getSrcName()
throws GSSException
getSrcName in interface GSSContextGSSException
public GSSName getTargName()
throws GSSException
getTargName in interface GSSContextGSSException
public Oid getMech()
throws GSSException
getMech in interface GSSContextGSSException
public GSSCredential getDelegCred()
throws GSSException
getDelegCred in interface GSSContextGSSException
public boolean isInitiator()
throws GSSException
isInitiator in interface GSSContextGSSException
public void dispose()
throws GSSException
dispose in interface GSSContextGSSException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||