// Token: 0x06001659 RID: 5721 RVA: 0x00054610 File Offset: 0x00052810
        public static bool TryConvertOutputObjectKeyProperties(ConvertOutputPropertyEventArgs args, out object convertedValue)
        {
            convertedValue = null;
            ConfigurableObject configurableObject = args.ConfigurableObject;
            PropertyDefinition property           = args.Property;
            string             propertyInStr      = args.PropertyInStr;
            object             value = args.Value;

            if (value == null)
            {
                return(false);
            }
            if (!PswsKeyProperties.IsKeyProperty(configurableObject, property, propertyInStr))
            {
                return(false);
            }
            if (value is string)
            {
                convertedValue = UrlTokenConverter.UrlTokenEncode((string)value);
                return(true);
            }
            if (value is ObjectId)
            {
                convertedValue = new UrlTokenEncodedObjectId(value.ToString());
                return(true);
            }
            if (value is IUrlTokenEncode)
            {
                ((IUrlTokenEncode)value).ReturnUrlTokenEncodedString = true;
                convertedValue = value;
                return(true);
            }
            throw new NotSupportedException(string.Format("Value with type {0} is not supported.", value.GetType()));
        }
        // Token: 0x06000DE8 RID: 3560 RVA: 0x000298FC File Offset: 0x00027AFC
        public override string ToString()
        {
            string text  = SecurityPrincipalIdParameter.MapSidToAlias(base.RawIdentity);
            string text2 = (!string.IsNullOrEmpty(text)) ? text : base.ToString();

            if (this.ReturnUrlTokenEncodedString && text2 != null)
            {
                text2 = UrlTokenConverter.UrlTokenEncode(text2);
            }
            return(text2);
        }
        // Token: 0x06001657 RID: 5719 RVA: 0x000544FC File Offset: 0x000526FC
        public static bool TryDecodeIIdentityParameter(IIdentityParameter identity, out IIdentityParameter decodedIdentity)
        {
            decodedIdentity = null;
            if (identity == null)
            {
                return(false);
            }
            string rawIdentity = identity.RawIdentity;

            if (string.IsNullOrWhiteSpace(rawIdentity))
            {
                return(false);
            }
            Type   type = identity.GetType();
            string text;

            if (!UrlTokenConverter.TryUrlTokenDecode(rawIdentity, out text))
            {
                return(false);
            }
            try
            {
                decodedIdentity = (Activator.CreateInstance(type, new object[]
                {
                    text
                }) as IIdentityParameter);
            }
            catch (TargetInvocationException ex)
            {
                throw ex.InnerException;
            }
            catch (MissingMethodException arg)
            {
                throw new InvalidOperationException(string.Format("DEV Bug: The type {0} must have ctor(string) in order to be parsed from string input. Exception: {1}", type, arg));
            }
            return(decodedIdentity != null);
        }