**** Merged from MCS ****
[mono-project.git] / mcs / tools / security / certview / X509ExtensionsHandler.cs
blobfc60454a200cf241c9a1be128a15c831b21bf2a7
1 //
2 // ExtensionsHandler.cs: Extensions Configuration Handler (not GUI specific)
3 //
4 // Author:
5 // Sebastien Pouliot (spouliot@motus.com)
6 //
7 // (C) 2003 Motus Technologies Inc. (http://www.motus.com)
8 //
10 using System;
11 using System.Collections;
12 using System.Configuration;
13 using System.Xml;
15 namespace Mono.Tools.CertView {
17 public class X509ExtensionsHandler : DictionarySectionHandler {
19 public X509ExtensionsHandler () : base () {}
21 public override object Create (object parent, object context, XmlNode section)
23 XmlNodeList xnl = section.SelectNodes ("/X509.Extensions/Extension");
24 if (xnl == null)
25 return null;
27 Hashtable ht = new Hashtable ();
28 foreach (XmlNode xn in xnl) {
29 XmlAttribute xaOid = xn.Attributes ["OID"];
30 XmlAttribute xaClass = xn.Attributes ["Class"];
31 if ((xaOid != null) && (xaClass != null))
32 ht.Add (xaOid.InnerText, xaClass.InnerText);
34 return ht;