Top Description Fields Constructors Methods
com.ongres.scram.common.gssapi

public Class Gs2Header

extends AbstractStringWritable
Class Inheritance
Imports
com.ongres.scram.common.util.StringWritableCsv, .AbstractStringWritable, com.ongres.scram.common.ScramStringFormatting

GSS Header. Format: gs2-header = gs2-cbind-flag "," [ authzid ] "," gs2-cbind-flag = ("p=" cb-name) / "n" / "y" authzid = "a=" saslname Current implementation does not support channel binding. If p is used as the cbind flag, the cb-name value is not validated.
See Also
[RFC5802] Formal Syntax

Field Summary

Modifier and TypeField and Description
private final Gs2AttributeValue
private final Gs2AttributeValue

Constructor Summary

AccessConstructor and Description
public
Gs2Header(Gs2CbindFlag
The channel binding flag
cbindFlag
,
String
The channel-binding name. Should be not null iif channel binding is required
cbName
,
String
The optional SASL authorization identity
authzid
)

Construct and validates a Gs2Header.

public
Gs2Header(Gs2CbindFlag
The channel binding flag
cbindFlag
,
String
The channel-binding name. Should be not null iif channel binding is required
cbName
)

Construct and validates a Gs2Header with no authzid.

public
Gs2Header(Gs2CbindFlag
The channel binding flag
cbindFlag
)

Construct and validates a Gs2Header with no authzid nor channel binding.

Method Summary

Modifier and TypeMethod and Description
public String
public Gs2CbindFlag
public String
public static Gs2Header

Returns:

The parsed Gs2Header object
parseFrom
(String
The String containing the Gs2Header
message
)

Read a Gs2Header from a String.

public StringBuffer
writeTo(StringBuffer
Where to write the data.
sb
)

Implements com.ongres.scram.common.util.StringWritable.writeTo.

Write the class information to the given StringBuffer.
Inherited from com.ongres.scram.common.util.AbstractStringWritable:
toString

Field Detail

authzidback to summary
private final Gs2AttributeValue authzid
cbindback to summary
private final Gs2AttributeValue cbind

Constructor Detail

Gs2Headerback to summary
public Gs2Header(Gs2CbindFlag cbindFlag, String cbName, String authzid) throws IllegalArgumentException

Construct and validates a Gs2Header. Only provide the channel binding name if the channel binding flag is set to required.

Parameters
cbindFlag:Gs2CbindFlag

The channel binding flag

cbName:String

The channel-binding name. Should be not null iif channel binding is required

authzid:String

The optional SASL authorization identity

Exceptions
IllegalArgumentException:
If the channel binding flag and argument are invalid
Gs2Headerback to summary
public Gs2Header(Gs2CbindFlag cbindFlag, String cbName) throws IllegalArgumentException

Construct and validates a Gs2Header with no authzid. Only provide the channel binding name if the channel binding flag is set to required.

Parameters
cbindFlag:Gs2CbindFlag

The channel binding flag

cbName:String

The channel-binding name. Should be not null iif channel binding is required

Exceptions
IllegalArgumentException:
If the channel binding flag and argument are invalid
Gs2Headerback to summary
public Gs2Header(Gs2CbindFlag cbindFlag)

Construct and validates a Gs2Header with no authzid nor channel binding.

Parameters
cbindFlag:Gs2CbindFlag

The channel binding flag

Exceptions
IllegalArgumentException:
If the channel binding is supported (no cbname can be provided here)

Method Detail

getAuthzidback to summary
public String getAuthzid()
getChannelBindingFlagback to summary
public Gs2CbindFlag getChannelBindingFlag()
getChannelBindingNameback to summary
public String getChannelBindingName()
parseFromback to summary
public static Gs2Header parseFrom(String message) throws IllegalArgumentException

Read a Gs2Header from a String. String may contain trailing fields that will be ignored.

Parameters
message:String

The String containing the Gs2Header

Returns:Gs2Header

The parsed Gs2Header object

Exceptions
IllegalArgumentException:
If the format/values of the String do not conform to a Gs2Header
writeToback to summary
public StringBuffer writeTo(StringBuffer sb)

Implements com.ongres.scram.common.util.StringWritable.writeTo.

Doc from com.ongres.scram.common.util.StringWritable.writeTo.

Write the class information to the given StringBuffer.

Parameters
sb:StringBuffer

Where to write the data.

Returns:StringBuffer

The same StringBuffer.

Annotations
@Override