Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2015-04-28 20:04:42 +0300
committerMarek Safar <marek.safar@gmail.com>2015-04-28 20:05:32 +0300
commit11ecdc6b6f83baf09f6ef2afc9be6185edb870d7 (patch)
treef50b131477773fa07bd8024b7e93eab6ee9ead85 /mcs/class/corlib/System.Security
parenta27db5252facf504e7995e6abe41ab5f1d3ec506 (diff)
[corlib] More cryptography from reference sources
Diffstat (limited to 'mcs/class/corlib/System.Security')
-rw-r--r--mcs/class/corlib/System.Security/SecurityElement.cs67
1 files changed, 67 insertions, 0 deletions
diff --git a/mcs/class/corlib/System.Security/SecurityElement.cs b/mcs/class/corlib/System.Security/SecurityElement.cs
index ca0513ba86a..0212e8b390a 100644
--- a/mcs/class/corlib/System.Security/SecurityElement.cs
+++ b/mcs/class/corlib/System.Security/SecurityElement.cs
@@ -33,11 +33,19 @@ using System.Globalization;
using System.Collections;
using System.Runtime.InteropServices;
using System.Text;
+using System.Diagnostics.Contracts;
using Mono.Xml;
namespace System.Security {
+ internal enum SecurityElementType
+ {
+ Regular = 0,
+ Format = 1,
+ Comment = 2
+ }
+
[ComVisible (true)]
[Serializable]
public sealed class SecurityElement
@@ -454,5 +462,64 @@ namespace System.Security {
}
return null;
}
+
+ internal string m_strTag {
+ get {
+ return tag;
+ }
+ }
+
+ internal string m_strText {
+ get {
+ return text;
+ }
+ set {
+ text = value;
+ }
+ }
+
+ internal ArrayList m_lAttributes {
+ get {
+ return attributes;
+ }
+ }
+
+ internal ArrayList InternalChildren {
+ get {
+ return children;
+ }
+ }
+
+ internal String SearchForTextOfLocalName(String strLocalName)
+ {
+ // Search on each child in order and each
+ // child's child, depth-first
+
+ if (strLocalName == null)
+ throw new ArgumentNullException( "strLocalName" );
+ Contract.EndContractBlock();
+
+ // Note: we don't check for a valid tag here because
+ // an invalid tag simply won't be found.
+
+ // First we check this.
+
+ if (tag == null) return null;
+ if (tag.Equals( strLocalName ) || tag.EndsWith( ":" + strLocalName, StringComparison.Ordinal ))
+ return Unescape( text );
+ if (children == null)
+ return null;
+
+ IEnumerator enumerator = children.GetEnumerator();
+
+ while (enumerator.MoveNext())
+ {
+ String current = ((SecurityElement)enumerator.Current).SearchForTextOfLocalName( strLocalName );
+
+ if (current != null)
+ return current;
+ }
+ return null;
+ }
}
}