The PermanentEntryID structure identifies a specific object in the address book.
        /// <summary>
        /// Parse PermanentEntryID structure from byte array.
        /// </summary>
        /// <param name="bytes">The byte array to be parsed.</param>
        /// <returns>An PermanentEntryID structure instance.</returns>
        public static PermanentEntryID ParsePermanentEntryIDFromBytes(byte[] bytes)
        {
            int index = 0;

            PermanentEntryID entryID = new PermanentEntryID
            {
                IDType = bytes[index++],
                R1 = bytes[index++],
                R2 = bytes[index++],
                R3 = bytes[index++],
                ProviderUID = new FlatUID_r
                {
                    Ab = new byte[Constants.FlatUIDByteSize]
                }
            };
            for (int i = 0; i < Constants.FlatUIDByteSize; i++)
            {
                entryID.ProviderUID.Ab[i] = bytes[index++];
            }

            // R4: 4 bytes
            entryID.R4 = (uint)BitConverter.ToInt32(bytes, index);
            index += 4;

            // DisplayType: 4 bytes
            entryID.DisplayTypeString = (DisplayTypeValue)BitConverter.ToInt32(bytes, index);
            index += 4;

            // DistinguishedName: variable 
            entryID.DistinguishedName = System.Text.Encoding.Default.GetString(bytes, index, bytes.Length - index - 1);
            return entryID;
        }