Class GuidHelper

java.lang.Object
com.atlassian.crowd.directory.ldap.util.GuidHelper

public class GuidHelper extends Object
Util for GUID (externalId) transformations
Since:
v2.7.0
  • Field Details

  • Constructor Details

    • GuidHelper

      public GuidHelper()
  • Method Details

    • getGUIDAsString

      public static String getGUIDAsString(byte[] inArr)
      The returned representation doesn't match AD's string representation, but it doesn't matter as the GUID should be treated as an opaque identifier. Basically, the method is a byte array to hex string. AD chooses to order the hex string in partial reverse, eg. Normal Hex String: 6797e1e5ecb5154f960f865c28c015fa AD Formatted String: e5e19767-b5ec-4f15-960f-865c28c015fa This method returns the "normal" hex string.
      Parameters:
      inArr - guid
      Returns:
      guid in byte-string form
    • convertToADGUID

      public static String convertToADGUID(String guid)
      Converts the HEX GUID to AD GUID
    • encodeGUIDForSearch

      public static String encodeGUIDForSearch(String guid)
      Returns Byte String representation of GUID suitable for search.

      Example:

       Input:  6797e1e5ecb5154f960f865c28c015fa
       Result: \67\97\e1\e5\ec\b5\15\4f\96\0f\86\5c\28\c0\15\fa
       
      Parameters:
      guid - the guid to be used in search
      Returns:
      byte string encoded form for AD search