PkixPolicyNode.cs :  » PDF » iTextSharp » Org » BouncyCastle » Pkix » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » PDF » iTextSharp 
iTextSharp » Org » BouncyCastle » Pkix » PkixPolicyNode.cs
using System;
using System.Collections;
using System.Text;

using Org.BouncyCastle.Utilities;
using Org.BouncyCastle.Utilities.Collections;

namespace Org.BouncyCastle.Pkix{
  /// <summary>
  /// Summary description for PkixPolicyNode.
  /// </summary>
  public class PkixPolicyNode
//    : IPolicyNode
  {
    protected IList        mChildren;
    protected int        mDepth;
    protected ISet        mExpectedPolicies;
    protected PkixPolicyNode  mParent;
    protected ISet        mPolicyQualifiers;
    protected string      mValidPolicy;
    protected bool        mCritical;

    public virtual int Depth
    {
      get { return this.mDepth; }
    }

    public virtual IEnumerable Children
    {
      get { return new EnumerableProxy(mChildren); }
    }

    public virtual bool IsCritical
    {
      get { return this.mCritical; }
      set { this.mCritical = value; }
    }

    public virtual ISet PolicyQualifiers
    {
      get { return new HashSet(this.mPolicyQualifiers); }
    }

    public virtual string ValidPolicy
    {
      get { return this.mValidPolicy; }
    }

    public virtual bool HasChildren
    {
      get { return mChildren.Count != 0; }
    }

    public virtual ISet ExpectedPolicies
    {
      get { return new HashSet(this.mExpectedPolicies); }
      set { this.mExpectedPolicies = new HashSet(value); }
    }

    public virtual PkixPolicyNode Parent
    {
      get { return this.mParent; }
      set { this.mParent = value; }
    }

    /// Constructors
    public PkixPolicyNode(
      IList      children,
      int        depth,
      ISet      expectedPolicies,
      PkixPolicyNode  parent,
      ISet      policyQualifiers,
      string      validPolicy,
      bool      critical)
    {
      ArrayList newChildren = new ArrayList();
      if (children != null)
      {
        newChildren.AddRange(children);
      }

      this.mChildren = newChildren;
      this.mDepth = depth;
      this.mExpectedPolicies = expectedPolicies;
      this.mParent = parent;
      this.mPolicyQualifiers = policyQualifiers;
      this.mValidPolicy = validPolicy;
      this.mCritical = critical;
    }

    public virtual void AddChild(
      PkixPolicyNode child)
    {
      child.Parent = this;
      mChildren.Add(child);
    }

    public virtual void RemoveChild(
      PkixPolicyNode child)
    {
      mChildren.Remove(child);
    }

    public override string ToString()
    {
      return ToString("");
    }

    public virtual string ToString(
      string indent)
    {
      StringBuilder buf = new StringBuilder();
      buf.Append(indent);
      buf.Append(mValidPolicy);
      buf.Append(" {");
      buf.Append(Platform.NewLine);

      foreach (PkixPolicyNode child in mChildren)
      {
        buf.Append(child.ToString(indent + "    "));
      }

      buf.Append(indent);
      buf.Append("}");
      buf.Append(Platform.NewLine);
      return buf.ToString();
    }

    public virtual object Clone()
    {
      return Copy();
    }

    public virtual PkixPolicyNode Copy()
    {
      PkixPolicyNode node = new PkixPolicyNode(
        new ArrayList(),
        mDepth,
        new HashSet(mExpectedPolicies),
        null,
        new HashSet(mPolicyQualifiers),
        mValidPolicy,
        mCritical);

      foreach (PkixPolicyNode child in mChildren)
      {
        PkixPolicyNode copy = child.Copy();
        copy.Parent = node;
        node.AddChild(copy);
      }

      return node;
    }
  }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.