Package com.ongres.scram.common.gssapi
Class Gs2Header
java.lang.Object
com.ongres.scram.common.util.AbstractStringWritable
com.ongres.scram.common.gssapi.Gs2Header
- All Implemented Interfaces:
StringWritable
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:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGs2Header
(Gs2CbindFlag cbindFlag) Construct and validates a Gs2Header with no authzid nor channel binding.Gs2Header
(Gs2CbindFlag cbindFlag, String cbName) Construct and validates a Gs2Header with no authzid.Gs2Header
(Gs2CbindFlag cbindFlag, String cbName, String authzid) Construct and validates a Gs2Header. -
Method Summary
Modifier and TypeMethodDescriptionstatic Gs2Header
Read a Gs2Header from a String.writeTo
(StringBuffer sb) Write the class information to the given StringBuffer.Methods inherited from class com.ongres.scram.common.util.AbstractStringWritable
toString
-
Field Details
-
cbind
-
authzid
-
-
Constructor Details
-
Gs2Header
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
- The channel binding flagcbName
- The channel-binding name. Should be not null iif channel binding is requiredauthzid
- The optional SASL authorization identity- Throws:
IllegalArgumentException
- If the channel binding flag and argument are invalid
-
Gs2Header
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
- The channel binding flagcbName
- The channel-binding name. Should be not null iif channel binding is required- Throws:
IllegalArgumentException
- If the channel binding flag and argument are invalid
-
Gs2Header
Construct and validates a Gs2Header with no authzid nor channel binding.- Parameters:
cbindFlag
- The channel binding flag- Throws:
IllegalArgumentException
- If the channel binding is supported (no cbname can be provided here)
-
-
Method Details
-
getChannelBindingFlag
-
getChannelBindingName
-
getAuthzid
-
writeTo
Description copied from interface:StringWritable
Write the class information to the given StringBuffer.- Parameters:
sb
- Where to write the data.- Returns:
- The same StringBuffer.
-
parseFrom
Read a Gs2Header from a String. String may contain trailing fields that will be ignored.- Parameters:
message
- The String containing the Gs2Header- Returns:
- The parsed Gs2Header object
- Throws:
IllegalArgumentException
- If the format/values of the String do not conform to a Gs2Header
-