Class Gs2Util

    • Constructor Detail

      • Gs2Util

        Gs2Util()
    • 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 name
        mechanisms - the array of mechanism names
        Returns:
        true if the given name is among the given mechanism names and false otherwise
      • getPlusMechanisms

        public static String[] getPlusMechanisms​(String[] mechanisms)
      • createChannelBinding

        public static ChannelBinding createChannelBinding​(byte[] header,
                                                          boolean gs2CbFlagPUsed,
                                                          byte[] bindingData)
        Create a ChannelBinding 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-flag
        gs2CbFlagPUsed - whether or not a gs2-cb-flag of "p" is used
        bindingData - the channel binding data
        Returns:
        the ChannelBinding