APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.security.jgss.krb5

pack-priv Class Krb5Context

extends Object
implements GSSContextSpi
Class Inheritance
All Implemented Interfaces
sun.security.jgss.spi.GSSContextSpi
Imports
org.ietf.jgss.*, sun.security.util.HexDumpEncoder, sun.security.jgss.GSSUtil, .GSSCaller, .TokenTracker, sun.security.jgss.spi.*, sun.security.krb5.*, java.io.InputStream, .InvalidObjectException, .IOException, .ObjectInputStream, .OutputStream, .Serial, java.security.*, javax.security.auth.Subject, javax.security.auth.kerberos.KerberosCredMessage, .KerberosPrincipal, .KerberosTicket, sun.security.krb5.internal.AuthorizationData

Implements the mechanism specific context class for the Kerberos v5 GSS-API mechanism.
Authors
Mayank Upadhyay, Ram Marti
Since
1.4

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
Krb5Context.KerberosSessionKey

The session key returned by inquireSecContext(KRB5_INQ_SSPI_SESSION_KEY)

Field Summary

Modifier and TypeField and Description
public static final int
private KrbApReq
private String
private AuthorizationData
private final GSSCaller
private ChannelBinding
private CipherHelper
private boolean
private boolean
private Krb5CredElement
private boolean
private final boolean
public static final int
private boolean
private boolean
private EncryptionKey
private int
private int
private boolean
private Krb5CredElement
private Krb5NameElement
private int
private final Object
private Krb5NameElement
private final Object
private TokenTracker
private boolean
private boolean
private Credentials
public static final int
private int
private static final int
private static final int
private static final int
private static final int
private Credentials
private boolean[]

Constructor Summary

AccessConstructor and Description
pack-priv
Krb5Context(GSSCaller caller, Krb5NameElement peerName, Krb5CredElement myCred, int lifetime)

Constructor for Krb5Context to be called on the context initiator's side.

pack-priv
Krb5Context(GSSCaller caller, Krb5CredElement myCred)

Constructor for Krb5Context to be called on the context acceptor's side.

public
Krb5Context(GSSCaller caller, byte[] interProcessToken)

Constructor for Krb5Context to import a previously exported context.

Method Summary

Modifier and TypeMethod and Description
public final byte[]

Returns:

any token required to be sent to the peer It is responsibility of the caller to send the token to its peer for processing.
acceptSecContext
(InputStream
contains the token received from the peer.
is
,
int mechTokenSize)

Implements sun.security.jgss.spi.GSSContextSpi.acceptSecContext.

Acceptor's context establishment call.

public final void
dispose()

Implements sun.security.jgss.spi.GSSContextSpi.dispose.

Releases context resources and terminates the context between 2 peer.

public final byte[]
export()

Implements sun.security.jgss.spi.GSSContextSpi.export.

Produces a token representing this context.

public final boolean
pack-priv GSSCaller
pack-priv final ChannelBinding
pack-priv final CipherHelper
getCipherHelper(EncryptionKey ckey)

Get the context specific DESCipher instance, invoked in MessageToken.init()

public final boolean
getConfState()

Implements sun.security.jgss.spi.GSSContextSpi.getConfState.

Is confidentiality available?

public final boolean
getCredDelegState()

Implements sun.security.jgss.spi.GSSContextSpi.getCredDelegState.

Is credential delegation enabled?

public final GSSCredentialSpi

Returns:

GSSCredentialSpi object for the delegated credential
getDelegCred
()

Implements sun.security.jgss.spi.GSSContextSpi.getDelegCred.

Returns the delegated credential for the context.

public final boolean
private static String
getHexBytes(byte[] bytes, int pos, int len)

public final boolean
private EncryptionKey
public final int
public final int
getLifetime()

Implements sun.security.jgss.spi.GSSContextSpi.getLifetime.

The lifetime remaining for this context.

public final Oid

Returns:

the Oid of this context
getMech
()

Implements sun.security.jgss.spi.GSSContextSpi.getMech.

Returns the mechanism oid.

public final byte[]
getMIC(byte[] inMsg, int offset, int len, MessageProp msgProp)

Implements sun.security.jgss.spi.GSSContextSpi.getMIC.

private int
getMIC(byte[] inMsg, int offset, int len, byte[] outBuf, int outOffset, MessageProp msgProp)

private void
getMIC(byte[] inMsg, int offset, int len, OutputStream os, MessageProp msgProp)

public final void
getMIC(InputStream is, OutputStream os, MessageProp msgProp)

Implements sun.security.jgss.spi.GSSContextSpi.getMIC.

Applies per-message integrity services.

public final boolean
getMutualAuthState()

Implements sun.security.jgss.spi.GSSContextSpi.getMutualAuthState.

Is mutual authentication enabled?

public final Provider
public final boolean
getReplayDetState()

Implements sun.security.jgss.spi.GSSContextSpi.getReplayDetState.

Is replay detection enabled on the GSS wrap and MIC tokens?

public final boolean
getSequenceDetState()

Implements sun.security.jgss.spi.GSSContextSpi.getSequenceDetState.

Is sequence checking enabled on the GSS Wrap and MIC tokens?

public final GSSNameSpi

Returns:

initiator name
getSrcName
()

Implements sun.security.jgss.spi.GSSContextSpi.getSrcName.

Returns the context initiator name.

public final GSSNameSpi

Returns:

context acceptor(target) name
getTargName
()

Implements sun.security.jgss.spi.GSSContextSpi.getTargName.

Returns the context acceptor.

public final int

Returns:

the maximum size for the input message that can be provided to the wrap() method in order to guarantee that these requirements are met.
getWrapSizeLimit
(int
the quality of protection that the context will be asked to provide.
qop
,
boolean
a flag indicating whether confidentiality will be requested or not
confReq
,
int maxTokSize)

Implements sun.security.jgss.spi.GSSContextSpi.getWrapSizeLimit.

Queries the context for largest data size to accommodate the specified protection and be <= maxTokSize.

pack-priv final int
public final byte[]

Returns:

any token required to be sent to the peer It is responsibility of the caller to send the token to its peer for processing.
initSecContext
(InputStream
contains the token received from the peer. On the first call it will be ignored.
is
,
int mechTokenSize)

Implements sun.security.jgss.spi.GSSContextSpi.initSecContext.

Initiator context establishment call.

public Object
inquireSecContext(String type)

Implements sun.security.jgss.spi.GSSContextSpi.inquireSecContext.

Return the mechanism-specific attribute associated with type.

public final boolean
public final boolean

Returns:

boolean indicating if this is initiator (true) or target (false)
isInitiator
()

Implements sun.security.jgss.spi.GSSContextSpi.isInitiator.

Tests if this is the initiator side of the context.

public final boolean

Returns:

boolean indicating if per-message methods can be called.
isProtReady
()

Implements sun.security.jgss.spi.GSSContextSpi.isProtReady.

Tests if the context can be used for per-message service.

public final boolean
isTransferable()

Implements sun.security.jgss.spi.GSSContextSpi.isTransferable.

Method to determine if the context can be exported and then re-imported.

private static String
printState(int state)

public final void
public final void
requestConf(boolean value)

Implements sun.security.jgss.spi.GSSContextSpi.requestConf.

Requests that confidentiality be available.

public final void
requestCredDeleg(boolean value)

Implements sun.security.jgss.spi.GSSContextSpi.requestCredDeleg.

Requests that credential delegation be done during context establishment.

public final void
requestDelegPolicy(boolean value)

Implements sun.security.jgss.spi.GSSContextSpi.requestDelegPolicy.

Requests that the deleg policy be respected.

public final void
requestInteg(boolean value)

Implements sun.security.jgss.spi.GSSContextSpi.requestInteg.

Requests that integrity be available.

public void
requestLifetime(int lifetime)

Implements sun.security.jgss.spi.GSSContextSpi.requestLifetime.

Requests the desired lifetime.

public final void
requestMutualAuth(boolean value)

Implements sun.security.jgss.spi.GSSContextSpi.requestMutualAuth.

Requests that mutual authentication be done during context establishment.

public final void
requestReplayDet(boolean value)

Implements sun.security.jgss.spi.GSSContextSpi.requestReplayDet.

Requests that replay detection be done on the GSS wrap and MIC tokens.

public final void
requestSequenceDet(boolean value)

Implements sun.security.jgss.spi.GSSContextSpi.requestSequenceDet.

Requests that sequence checking be done on the GSS wrap and MIC tokens.

pack-priv final void
resetMySequenceNumber(int seqNumber)

pack-priv final void
resetPeerSequenceNumber(int seqNumber)

public void
setAuthTime(String authTime)

public void
public final void
setChannelBinding(ChannelBinding channelBinding)

Implements sun.security.jgss.spi.GSSContextSpi.setChannelBinding.

Sets the channel bindings to be used during context establishment.

pack-priv final void
setConfState(boolean state)

pack-priv final void
setCredDelegState(boolean state)

pack-priv final void
setDelegCred(Krb5CredElement delegatedCred)

Called on the acceptor side to store the delegated credentials received in the AcceptSecContextToken.

pack-priv final void
setDelegPolicyState(boolean state)

pack-priv final void
setIntegState(boolean state)

pack-priv final void
setKey(int keySrc, EncryptionKey key)

pack-priv final void
setMutualAuthState(boolean state)

pack-priv final void
setReplayDetState(boolean state)

pack-priv final void
setSequenceDetState(boolean state)

private void
setSequencingAndReplayProps(MessageToken token, MessageProp prop)

Sets replay and sequencing information for a message token received form the peer.

private void
setSequencingAndReplayProps(MessageToken_v2 token, MessageProp prop)

Sets replay and sequencing information for a message token received form the peer.

public void
setTktFlags(boolean[] tktFlags)

private void
public final byte[]
unwrap(byte[] inBuf, int offset, int len, MessageProp msgProp)

Implements sun.security.jgss.spi.GSSContextSpi.unwrap.

For apps that want simplicity and don't care about buffer copies.

public final int
unwrap(byte[] inBuf, int inOffset, int len, byte[] outBuf, int outOffset, MessageProp msgProp)

public final int
unwrap(InputStream is, byte[] outBuf, int outOffset, MessageProp msgProp)

public final void
unwrap(InputStream is, OutputStream os, MessageProp msgProp)

Implements sun.security.jgss.spi.GSSContextSpi.unwrap.

Retrieves the message token previously encapsulated in the wrap call.

public final void
verifyMIC(byte[] inTok, int tokOffset, int tokLen, byte[] inMsg, int msgOffset, int msgLen, MessageProp msgProp)

Implements sun.security.jgss.spi.GSSContextSpi.verifyMIC.

private void
verifyMIC(InputStream is, byte[] inMsg, int msgOffset, int msgLen, MessageProp msgProp)

public final void
verifyMIC(InputStream is, InputStream msgStr, MessageProp mProp)

Implements sun.security.jgss.spi.GSSContextSpi.verifyMIC.

Checks the integrity of the supplied tokens.

public final byte[]
wrap(byte[] inBuf, int offset, int len, MessageProp msgProp)

Implements sun.security.jgss.spi.GSSContextSpi.wrap.

For apps that want simplicity and don't care about buffer copies.

public final int
wrap(byte[] inBuf, int inOffset, int len, byte[] outBuf, int outOffset, MessageProp msgProp)

public final void
wrap(byte[] inBuf, int offset, int len, OutputStream os, MessageProp msgProp)

public final void
wrap(InputStream is, OutputStream os, MessageProp msgProp)

Implements sun.security.jgss.spi.GSSContextSpi.wrap.

Provides per-message token encapsulation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait