APIdia Launch Partner
Top Description Fields Constructors Methods
sun.net.www.protocol.http.spnego

public Class NegotiatorImpl

extends Negotiator
Class Inheritance
Imports
java.io.IOException, java.util.Locale, org.ietf.jgss.GSSContext, .GSSException, .GSSName, .Oid, sun.net.www.protocol.http.HttpCallerInfo, .Negotiator, sun.security.jgss.GSSManagerImpl, .GSSContextImpl, .GSSUtil, .HttpCaller, sun.security.jgss.krb5.internal.TlsChannelBindingImpl, sun.security.util.ChannelBindingException, .TlsChannelBinding

This class encapsulates all JAAS and JGSS API calls in a separate class outside NegotiateAuthentication.java so that J2SE build can go smoothly without the presence of it.
Author
[email protected]
Since
1.6

Field Summary

Modifier and TypeField and Description
private GSSContext
private byte[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
disposeContext()

Overrides sun.net.www.protocol.http.Negotiator.disposeContext.

Releases any system resources and cryptographic information stored in the context object and invalidates the context.

public byte[]

Returns:

the first token
firstToken
()

Implements abstract sun.net.www.protocol.http.Negotiator.firstToken.

Return the first token of GSS, in SPNEGO, it's called NegTokenInit

private void
init(HttpCallerInfo hci)

Initialize the object, which includes:

  • Find out what GSS mechanism to use from the system property http.negotiate.mechanism.oid, defaults SPNEGO
  • Creating the GSSName for the target host, "HTTP/"+hostname
  • Creating GSSContext
  • A first call to initSecContext
public byte[]

Returns:

the next token
nextToken
(byte[]
the token received from server
token
)

Implements abstract sun.net.www.protocol.http.Negotiator.nextToken.

Return the rest tokens of GSS, in SPNEGO, it's called NegTokenTarg

Field Detail

contextback to summary
private GSSContext context
oneTokenback to summary
private byte[] oneToken

Constructor Detail

NegotiatorImplback to summary
public NegotiatorImpl(HttpCallerInfo hci) throws IOException

Constructor

Exceptions
IOException:
If negotiator cannot be constructed

Method Detail

disposeContextback to summary
public void disposeContext() throws IOException

Overrides sun.net.www.protocol.http.Negotiator.disposeContext.

Releases any system resources and cryptographic information stored in the context object and invalidates the context.

Annotations
@Override
Exceptions
IOException:
containing a reason of failure in the cause
firstTokenback to summary
public byte[] firstToken()

Implements abstract sun.net.www.protocol.http.Negotiator.firstToken.

Return the first token of GSS, in SPNEGO, it's called NegTokenInit

Returns:byte[]

the first token

Annotations
@Override
initback to summary
private void init(HttpCallerInfo hci) throws GSSException, ChannelBindingException

Initialize the object, which includes:

  • Find out what GSS mechanism to use from the system property http.negotiate.mechanism.oid, defaults SPNEGO
  • Creating the GSSName for the target host, "HTTP/"+hostname
  • Creating GSSContext
  • A first call to initSecContext
nextTokenback to summary
public byte[] nextToken(byte[] token) throws IOException

Implements abstract sun.net.www.protocol.http.Negotiator.nextToken.

Return the rest tokens of GSS, in SPNEGO, it's called NegTokenTarg

Parameters
token:byte[]

the token received from server

Returns:byte[]

the next token

Annotations
@Override
Exceptions
IOException:
if the token cannot be created successfully