Example #1
0
		// no quote processing
		static private X520.AttributeTypeAndValue ReadAttribute (string value, ref int pos)
		{
			while ((value[pos] == ' ') && (pos < value.Length))
				pos++;

			// get '=' position in substring
			int equal = value.IndexOf ('=', pos);
			if (equal == -1) {
				string msg =  ("No attribute found.");
				throw new FormatException (msg);
			}

			string s = value.Substring (pos, equal - pos);
			X520.AttributeTypeAndValue atv = GetAttributeFromOid (s);
			if (atv == null) {
				string msg =  ("Unknown attribute '{0}'.");
				throw new FormatException (String.Format (msg, s));
			}
			pos = equal + 1; // skip the '='
			return atv;
		}