public static IAuthDataElement ParseAuthDataElement(AuthorizationDataElement element)
        {
            IAuthDataElement authDataElement;

            switch ((AuthorizationData_elementType)element.ad_type.Value)
            {
            case AuthorizationData_elementType.AD_IF_RELEVANT:
                authDataElement = AdIfRelevent.Parse(element);
                break;

            case AuthorizationData_elementType.AD_WIN2K_PAC:
                authDataElement = AdWin2KPac.Parse(element);
                break;

            case AuthorizationData_elementType.AD_FX_FAST_USED:
                authDataElement = AdFxFastUsed.Parse(element);
                break;

            case AuthorizationData_elementType.KERB_AUTH_DATA_TOKEN_RESTRICTIONS:
                authDataElement = KerbAuthDataTokenRestrictions.Parse(element);
                break;

            default:
                return(null);
            }
            return(authDataElement);
        }
        public static AdWin2KPac Parse(AuthorizationDataElement element)
        {
            if (element.ad_type.Value != (int)AuthorizationData_elementType.AD_WIN2K_PAC)
            {
                throw new Exception();
            }
            var adWin2KPac = new AdWin2KPac();

            adWin2KPac.Pac = PacUtility.DecodePacType(element.ad_data.ByteArrayValue);
            return(adWin2KPac);
        }
 public static AdWin2KPac Parse(AuthorizationDataElement element)
 {
     if (element.ad_type.Value != (int)AuthorizationData_elementType.AD_WIN2K_PAC)
         throw new Exception();
     var adWin2KPac = new AdWin2KPac();
     adWin2KPac.Pac = PacUtility.DecodePacType(element.ad_data.ByteArrayValue);
     return adWin2KPac;
 }