|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsun.security.mule.jgss.spnego.SpNegoContext
public class SpNegoContext
Implements the mechanism specific context class for SPNEGO GSS-API mechanism
| Constructor Summary | |
|---|---|
SpNegoContext(SpNegoMechFactory factory,
byte[] interProcessToken)
Constructor for SpNegoContext to import a previously exported context. |
|
SpNegoContext(SpNegoMechFactory factory,
GSSCredentialSpi myCred)
Constructor for SpNegoContext to be called on the context acceptor's side. |
|
SpNegoContext(SpNegoMechFactory factory,
GSSNameSpi peerName,
GSSCredentialSpi myCred,
int lifetime)
Constructor for SpNegoContext to be called on the context initiator's side. |
|
| Method Summary | |
|---|---|
byte[] |
acceptSecContext(InputStream is,
int mechTokenSize)
Acceptor's context establishment call. |
void |
dispose()
Releases context resources and terminates the context between 2 peer. |
byte[] |
export()
Produces a token representing this context. |
boolean |
getAnonymityState()
|
boolean |
getConfState()
Is confidentiality available? |
boolean |
getCredDelegState()
Is credential delegation enabled? |
GSSCredentialSpi |
getDelegCred()
Returns the delegated credential for the context. |
boolean |
getIntegState()
Is integrity available? |
int |
getLifetime()
The lifetime remaining for this context. |
Oid |
getMech()
Returns the mechanism oid. |
byte[] |
getMIC(byte[] inMsg,
int offset,
int len,
MessageProp msgProp)
|
void |
getMIC(InputStream is,
OutputStream os,
MessageProp msgProp)
Applies per-message integrity services. |
boolean |
getMutualAuthState()
Is mutual authentication enabled? Since this is from the client's perspective, it essentially meas that the server is being authenticated. |
Oid |
getNegotiatedMech()
|
Provider |
getProvider()
|
boolean |
getReplayDetState()
Is replay detection enabled on the GSS wrap and MIC tokens? We enable replay detection if sequence checking is enabled. |
boolean |
getSequenceDetState()
Is sequence checking enabled on the GSS Wrap and MIC tokens? We enable sequence checking if replay detection is enabled. |
GSSNameSpi |
getSrcName()
|
GSSNameSpi |
getTargName()
|
int |
getWrapSizeLimit(int qop,
boolean confReq,
int maxTokSize)
Queries the context for largest data size to accomodate the specified protection and for the token to remain less then maxTokSize. |
byte[] |
initSecContext(InputStream is,
int mechTokenSize)
Initiator context establishment call. |
boolean |
isEstablished()
|
boolean |
isInitiator()
Tests if this is the initiator side of the context. |
boolean |
isMechContextEstablished()
|
boolean |
isProtReady()
Tests if the context can be used for per-message service. |
boolean |
isTransferable()
|
void |
requestAnonymity(boolean value)
|
void |
requestConf(boolean value)
Requests that confidentiality be available. |
void |
requestCredDeleg(boolean value)
Requests that credential delegation be done during context establishment. |
void |
requestInteg(boolean value)
Requests that integrity be available. |
void |
requestLifetime(int lifetime)
Requests the desired lifetime. |
void |
requestMutualAuth(boolean value)
Requests that mutual authentication be done during context establishment. |
void |
requestReplayDet(boolean value)
Requests that replay detection be done on the GSS wrap and MIC tokens. |
void |
requestSequenceDet(boolean value)
Requests that sequence checking be done on the GSS wrap and MIC tokens. |
void |
setChannelBinding(ChannelBinding channelBinding)
Sets the channel bindings to be used during context establishment. |
byte[] |
unwrap(byte[] inBuf,
int offset,
int len,
MessageProp msgProp)
For apps that want simplicity and dont care about buffer copies. |
void |
unwrap(InputStream is,
OutputStream os,
MessageProp msgProp)
Retrieves the message token previously encapsulated in the wrap call. |
void |
verifyMIC(byte[] inTok,
int tokOffset,
int tokLen,
byte[] inMsg,
int msgOffset,
int msgLen,
MessageProp msgProp)
|
void |
verifyMIC(InputStream is,
InputStream msgStr,
MessageProp msgProp)
Checks the integrity of the supplied tokens. |
byte[] |
wrap(byte[] inBuf,
int offset,
int len,
MessageProp msgProp)
For apps that want simplicity and don't care about buffer copies. |
void |
wrap(InputStream is,
OutputStream os,
MessageProp msgProp)
Provides per-message token encapsulation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SpNegoContext(SpNegoMechFactory factory,
GSSNameSpi peerName,
GSSCredentialSpi myCred,
int lifetime)
throws GSSException
GSSException
public SpNegoContext(SpNegoMechFactory factory,
GSSCredentialSpi myCred)
throws GSSException
GSSException
public SpNegoContext(SpNegoMechFactory factory,
byte[] interProcessToken)
throws GSSException
GSSException| Method Detail |
|---|
public final void requestConf(boolean value)
throws GSSException
requestConf in interface GSSContextSpiGSSExceptionpublic final boolean getConfState()
getConfState in interface GSSContextSpi
public final void requestInteg(boolean value)
throws GSSException
requestInteg in interface GSSContextSpiGSSExceptionpublic final boolean getIntegState()
getIntegState in interface GSSContextSpi
public final void requestCredDeleg(boolean value)
throws GSSException
requestCredDeleg in interface GSSContextSpiGSSExceptionpublic final boolean getCredDelegState()
getCredDelegState in interface GSSContextSpi
public final void requestMutualAuth(boolean value)
throws GSSException
requestMutualAuth in interface GSSContextSpiGSSExceptionpublic final boolean getMutualAuthState()
getMutualAuthState in interface GSSContextSpipublic final Oid getMech()
getMech in interface GSSContextSpipublic final Oid getNegotiatedMech()
public final Provider getProvider()
getProvider in interface GSSContextSpi
public final void dispose()
throws GSSException
GSSContextSpi
dispose in interface GSSContextSpiGSSException - may be thrownpublic final boolean isInitiator()
isInitiator in interface GSSContextSpipublic final boolean isProtReady()
isProtReady in interface GSSContextSpi
public final byte[] initSecContext(InputStream is,
int mechTokenSize)
throws GSSException
initSecContext in interface GSSContextSpiis - contains the token received from the peer. On the
first call it will be ignored.mechTokenSize - the size of the inner context token as read by
the GSS-Framework from the mechanism independent GSS-API level
header.
GSSException
public final byte[] acceptSecContext(InputStream is,
int mechTokenSize)
throws GSSException
acceptSecContext in interface GSSContextSpiis - contains the token received from the peer.mechTokenSize - the size of the inner context token as read by
the GSS-Framework from the mechanism independent GSS-API level
header.
GSSExceptionpublic final boolean isEstablished()
isEstablished in interface GSSContextSpipublic final boolean isMechContextEstablished()
public final byte[] export()
throws GSSException
GSSContextSpi
export in interface GSSContextSpiGSSException - may be thrown
public final void setChannelBinding(ChannelBinding channelBinding)
throws GSSException
setChannelBinding in interface GSSContextSpiGSSException
public final void requestAnonymity(boolean value)
throws GSSException
requestAnonymity in interface GSSContextSpiGSSExceptionpublic final boolean getAnonymityState()
getAnonymityState in interface GSSContextSpi
public void requestLifetime(int lifetime)
throws GSSException
requestLifetime in interface GSSContextSpiGSSExceptionpublic final int getLifetime()
getLifetime in interface GSSContextSpi
public final boolean isTransferable()
throws GSSException
isTransferable in interface GSSContextSpiGSSException
public final void requestSequenceDet(boolean value)
throws GSSException
requestSequenceDet in interface GSSContextSpiGSSExceptionpublic final boolean getSequenceDetState()
getSequenceDetState in interface GSSContextSpi
public final void requestReplayDet(boolean value)
throws GSSException
requestReplayDet in interface GSSContextSpiGSSExceptionpublic final boolean getReplayDetState()
getReplayDetState in interface GSSContextSpi
public final GSSNameSpi getTargName()
throws GSSException
getTargName in interface GSSContextSpiGSSException
public final GSSNameSpi getSrcName()
throws GSSException
getSrcName in interface GSSContextSpiGSSException
public final GSSCredentialSpi getDelegCred()
throws GSSException
getDelegCred in interface GSSContextSpiGSSExceptionGSSContext#getDelegCredState
public final int getWrapSizeLimit(int qop,
boolean confReq,
int maxTokSize)
throws GSSException
GSSContextSpi
getWrapSizeLimit in interface GSSContextSpiqop - the quality of protection that the context will be
asked to provide.confReq - a flag indicating whether confidentiality will be
requested or not
GSSException - may be thrown
public final byte[] wrap(byte[] inBuf,
int offset,
int len,
MessageProp msgProp)
throws GSSException
GSSContextSpi
wrap in interface GSSContextSpiGSSException
public final void wrap(InputStream is,
OutputStream os,
MessageProp msgProp)
throws GSSException
GSSContextSpi
wrap in interface GSSContextSpiis - the user-provided message to be protectedos - the token to be sent to the peer. It includes
the message from is with the requested protection.
GSSException - may be thrownMessageInfo,
unwrap
public final byte[] unwrap(byte[] inBuf,
int offset,
int len,
MessageProp msgProp)
throws GSSException
GSSContextSpi
unwrap in interface GSSContextSpiGSSException
public final void unwrap(InputStream is,
OutputStream os,
MessageProp msgProp)
throws GSSException
GSSContextSpi
unwrap in interface GSSContextSpiis - the token from the peeros - unprotected message datamsgProp - will contain the applied qop and confidentiality
of the input token and any informatory status values
GSSException - may be thrownMessageInfo,
wrap
public final byte[] getMIC(byte[] inMsg,
int offset,
int len,
MessageProp msgProp)
throws GSSException
getMIC in interface GSSContextSpiGSSException
public final void getMIC(InputStream is,
OutputStream os,
MessageProp msgProp)
throws GSSException
GSSContextSpi
getMIC in interface GSSContextSpiis - the user-provided messageos - the token to be sent to the peer along with the
message token. The message token is not encapsulated.msgProp - on input the desired QOP and output the applied QOP
GSSException
public final void verifyMIC(byte[] inTok,
int tokOffset,
int tokLen,
byte[] inMsg,
int msgOffset,
int msgLen,
MessageProp msgProp)
throws GSSException
verifyMIC in interface GSSContextSpiGSSException
public final void verifyMIC(InputStream is,
InputStream msgStr,
MessageProp msgProp)
throws GSSException
GSSContextSpi
verifyMIC in interface GSSContextSpiis - token generated by getMICmsgStr - the message to check integrity for
GSSException - may be thrown
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||