public class Gs2Header extends AbstractStringWritable
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.Modifier and Type | Field and Description |
---|---|
private java.util.Optional<Gs2AttributeValue> |
authzid |
private Gs2AttributeValue |
cbind |
Constructor and Description |
---|
Gs2Header(Gs2CbindFlag cbindFlag)
Construct and validates a Gs2Header with no authzid nor channel binding.
|
Gs2Header(Gs2CbindFlag cbindFlag,
java.lang.String cbName)
Construct and validates a Gs2Header with no authzid.
|
Gs2Header(Gs2CbindFlag cbindFlag,
java.lang.String cbName,
java.lang.String authzid)
Construct and validates a Gs2Header.
|
Modifier and Type | Method and Description |
---|---|
java.util.Optional<java.lang.String> |
getAuthzid() |
Gs2CbindFlag |
getChannelBindingFlag() |
java.util.Optional<java.lang.String> |
getChannelBindingName() |
static Gs2Header |
parseFrom(java.lang.String message)
Read a Gs2Header from a String.
|
java.lang.StringBuffer |
writeTo(java.lang.StringBuffer sb)
Write the class information to the given StringBuffer.
|
toString
private final Gs2AttributeValue cbind
private final java.util.Optional<Gs2AttributeValue> authzid
public Gs2Header(Gs2CbindFlag cbindFlag, java.lang.String cbName, java.lang.String authzid) throws java.lang.IllegalArgumentException
cbindFlag
- The channel binding flagcbName
- The channel-binding name. Should be not null iif channel binding is requiredauthzid
- The optional SASL authorization identityjava.lang.IllegalArgumentException
- If the channel binding flag and argument are invalidpublic Gs2Header(Gs2CbindFlag cbindFlag, java.lang.String cbName) throws java.lang.IllegalArgumentException
cbindFlag
- The channel binding flagcbName
- The channel-binding name. Should be not null iif channel binding is requiredjava.lang.IllegalArgumentException
- If the channel binding flag and argument are invalidpublic Gs2Header(Gs2CbindFlag cbindFlag)
cbindFlag
- The channel binding flagjava.lang.IllegalArgumentException
- If the channel binding is supported (no cbname can be provided here)public Gs2CbindFlag getChannelBindingFlag()
public java.util.Optional<java.lang.String> getChannelBindingName()
public java.util.Optional<java.lang.String> getAuthzid()
public java.lang.StringBuffer writeTo(java.lang.StringBuffer sb)
StringWritable
sb
- Where to write the data.public static Gs2Header parseFrom(java.lang.String message) throws java.lang.IllegalArgumentException
message
- The String containing the Gs2Headerjava.lang.IllegalArgumentException
- If the format/values of the String do not conform to a Gs2Header