Module jcifs

Class AvPairs

java.lang.Object
org.codelibs.jcifs.smb.ntlmssp.av.AvPairs

public final class AvPairs extends Object
Collection and utility class for managing NTLMSSP AV (Attribute-Value) pairs. Provides methods for encoding, decoding, and manipulating sets of AV pairs.
Author:
mbechler
  • Method Details

    • decode

      public static List<AvPair> decode(byte[] data) throws CIFSException
      Decode a list of AvPairs
      Parameters:
      data - the encoded AV pairs data
      Returns:
      individual pairs
      Throws:
      CIFSException - if decoding fails
    • contains

      public static boolean contains(List<AvPair> pairs, int type)
      Checks if the AV pairs list contains a pair of the specified type
      Parameters:
      pairs - the list of AV pairs to search
      type - the AV pair type to look for
      Returns:
      whether the list contains a pair of that type
    • get

      public static AvPair get(List<AvPair> pairs, int type)
      Gets the first AV pair of the specified type from the list
      Parameters:
      pairs - the list of AV pairs to search
      type - the AV pair type to retrieve
      Returns:
      first occurance of the given type
    • remove

      public static void remove(List<AvPair> pairs, int type)
      Remove all occurances of the given type
      Parameters:
      pairs - the list of AV pairs to modify
      type - the AV pair type to remove
    • replace

      public static void replace(List<AvPair> pairs, AvPair rep)
      Replace all occurances of the given type
      Parameters:
      pairs - the list of AV pairs to modify
      rep - the replacement AV pair
    • encode

      public static byte[] encode(List<AvPair> pairs)
      Encodes a list of AV pairs into byte array format
      Parameters:
      pairs - the list of AV pairs to encode
      Returns:
      encoded avpairs