Package org.wildfly.security.sasl.gs2
Class Gs2Util
- java.lang.Object
-
- org.wildfly.security.sasl.gs2.Gs2Util
-
class Gs2Util extends Object
- Author:
- Farah Juma
-
-
Field Summary
Fields Modifier and Type Field Description static int
TOKEN_HEADER_TAG
-
Constructor Summary
Constructors Constructor Description Gs2Util()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ChannelBinding
createChannelBinding(byte[] header, boolean gs2CbFlagPUsed, byte[] bindingData)
Create aChannelBinding
whose application data field is set to the given GS2 header, concatenated with, when a gs2-cb-flag of "p" is used, the given channel binding data.static String[]
getPlusMechanisms(String[] mechanisms)
static String[]
getSupportedSaslNamesForMechanisms(Oid[] mechanismOids)
Get the array of supported SASL mechanism names that corresponds to the given array of GSS-API mechanism object identifiers.static boolean
isIncluded(String name, String[] mechanisms)
Determine if the given mechanism name is among the given array of mechanism names.
-
-
-
Field Detail
-
TOKEN_HEADER_TAG
public static final int TOKEN_HEADER_TAG
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSupportedSaslNamesForMechanisms
public static String[] getSupportedSaslNamesForMechanisms(Oid[] mechanismOids) throws GSSException
Get the array of supported SASL mechanism names that corresponds to the given array of GSS-API mechanism object identifiers.- Parameters:
mechanismOids
- the array of GSS-API mechanism object identifiers- Returns:
- the array of supported SASL mechanism names that corresponds to the given array of GSS-API mechanism object identifiers
- Throws:
GSSException
- if an error occurs while mapping the GSS-API object identifiers to SASL names
-
isIncluded
public static boolean isIncluded(String name, String[] mechanisms)
Determine if the given mechanism name is among the given array of mechanism names.- Parameters:
name
- the mechanism namemechanisms
- the array of mechanism names- Returns:
true
if the given name is among the given mechanism names andfalse
otherwise
-
createChannelBinding
public static ChannelBinding createChannelBinding(byte[] header, boolean gs2CbFlagPUsed, byte[] bindingData)
Create aChannelBinding
whose application data field is set to the given GS2 header, concatenated with, when a gs2-cb-flag of "p" is used, the given channel binding data.- Parameters:
header
- the GS2 header, excluding the initial gs2-nonstd-flaggs2CbFlagPUsed
- whether or not a gs2-cb-flag of "p" is usedbindingData
- the channel binding data- Returns:
- the
ChannelBinding
-
-