|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsun.security.mule.jgss.krb5.Krb5Context
public class Krb5Context
Implements the mechanism specific context class for the Kerberos v5 GSS-API mechanism.
| Constructor Summary | |
|---|---|
Krb5Context(int caller,
byte[] interProcessToken)
Constructor for Krb5Context to import a previously exported context. |
|
Krb5Context(int caller,
sun.security.mule.jgss.krb5.Krb5CredElement myCred)
Constructor for Krb5Context to be called on the context acceptor's side. |
|
Krb5Context(int caller,
Krb5NameElement peerName,
sun.security.mule.jgss.krb5.Krb5CredElement myCred,
int lifetime)
Constructor for Krb5Context 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. |
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()
Returns the context initiator name. |
GSSNameSpi |
getTargName()
Returns the context acceptor. |
int |
getWrapSizeLimit(int qop,
boolean confReq,
int maxTokSize)
Queries the context for largest data size to accomodate the specified protection and be <= 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 |
isProtReady()
Tests if the context can be used for per-message service. |
boolean |
isTransferable()
Method to determine if the context can be exported and then re-imported. |
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 |
resetStateToNew()
|
void |
setChannelBinding(ChannelBinding channelBinding)
Sets the channel bindings to be used during context establishment. |
void |
setKerberosConfig(Config kerberosConfig)
|
int |
unwrap(byte[] inBuf,
int inOffset,
int len,
byte[] outBuf,
int outOffset,
MessageProp msgProp)
|
byte[] |
unwrap(byte[] inBuf,
int offset,
int len,
MessageProp msgProp)
For apps that want simplicity and dont care about buffer copies. |
int |
unwrap(InputStream is,
byte[] outBuf,
int outOffset,
MessageProp msgProp)
|
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 mProp)
Checks the integrity of the supplied tokens. |
int |
wrap(byte[] inBuf,
int inOffset,
int len,
byte[] outBuf,
int outOffset,
MessageProp msgProp)
|
byte[] |
wrap(byte[] inBuf,
int offset,
int len,
MessageProp msgProp)
For apps that want simplicity and don't care about buffer copies. |
void |
wrap(byte[] inBuf,
int offset,
int len,
OutputStream os,
MessageProp msgProp)
|
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 Krb5Context(int caller,
Krb5NameElement peerName,
sun.security.mule.jgss.krb5.Krb5CredElement myCred,
int lifetime)
throws GSSException
GSSException
public Krb5Context(int caller,
sun.security.mule.jgss.krb5.Krb5CredElement myCred)
throws GSSException
GSSException
public Krb5Context(int caller,
byte[] interProcessToken)
throws GSSException
GSSException| Method Detail |
|---|
public void setKerberosConfig(Config kerberosConfig)
public void resetStateToNew()
public final boolean isTransferable()
throws GSSException
isTransferable in interface GSSContextSpiGSSExceptionpublic final int getLifetime()
getLifetime in interface GSSContextSpi
public void requestLifetime(int lifetime)
throws GSSException
requestLifetime in interface GSSContextSpiGSSException
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 GSSContextSpi
public final void requestReplayDet(boolean value)
throws GSSException
requestReplayDet in interface GSSContextSpiGSSExceptionpublic final boolean getReplayDetState()
getReplayDetState in interface GSSContextSpi
public final void requestSequenceDet(boolean value)
throws GSSException
requestSequenceDet in interface GSSContextSpiGSSExceptionpublic final boolean getSequenceDetState()
getSequenceDetState in interface GSSContextSpi
public final void requestAnonymity(boolean value)
throws GSSException
requestAnonymity in interface GSSContextSpiGSSExceptionpublic final boolean getAnonymityState()
getAnonymityState in interface GSSContextSpi
public final void setChannelBinding(ChannelBinding channelBinding)
throws GSSException
setChannelBinding in interface GSSContextSpiGSSExceptionpublic final Oid getMech()
getMech in interface GSSContextSpi
public final GSSNameSpi getSrcName()
throws GSSException
getSrcName in interface GSSContextSpiGSSException
public final GSSNameSpi getTargName()
throws GSSException
getTargName in interface GSSContextSpiGSSException
public final GSSCredentialSpi getDelegCred()
throws GSSException
getDelegCred in interface GSSContextSpiGSSExceptionGSSContext#getDelegCredStatepublic 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.
GSSExceptionpublic final boolean isEstablished()
isEstablished in interface GSSContextSpi
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.
GSSException
public final int getWrapSizeLimit(int qop,
boolean confReq,
int maxTokSize)
throws GSSException
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 notoutputSize - the maximum size of the output token
GSSException
public final byte[] wrap(byte[] inBuf,
int offset,
int len,
MessageProp msgProp)
throws GSSException
GSSContextSpi
wrap in interface GSSContextSpiGSSException
public final int wrap(byte[] inBuf,
int inOffset,
int len,
byte[] outBuf,
int outOffset,
MessageProp msgProp)
throws GSSException
GSSException
public final void wrap(byte[] inBuf,
int offset,
int len,
OutputStream os,
MessageProp msgProp)
throws GSSException
GSSException
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 int unwrap(byte[] inBuf,
int inOffset,
int len,
byte[] outBuf,
int outOffset,
MessageProp msgProp)
throws GSSException
GSSException
public final int unwrap(InputStream is,
byte[] outBuf,
int outOffset,
MessageProp msgProp)
throws GSSException
GSSException
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 mProp)
throws GSSException
GSSContextSpi
verifyMIC in interface GSSContextSpiis - token generated by getMICmsgStr - the message to check integrity for
GSSException - may be thrown
public final byte[] export()
throws GSSException
export in interface GSSContextSpios - the output token will be written to this stream
GSSException
public final void dispose()
throws GSSException
dispose in interface GSSContextSpiGSSException - with major codes NO_CONTEXT, FAILURE.public final Provider getProvider()
getProvider in interface GSSContextSpi
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||