summary refs log tree commit diff
path: root/crypto/src/cms/DefaultAuthenticatedAttributeTableGenerator.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/cms/DefaultAuthenticatedAttributeTableGenerator.cs')
-rw-r--r--crypto/src/cms/DefaultAuthenticatedAttributeTableGenerator.cs25
1 files changed, 12 insertions, 13 deletions
diff --git a/crypto/src/cms/DefaultAuthenticatedAttributeTableGenerator.cs b/crypto/src/cms/DefaultAuthenticatedAttributeTableGenerator.cs
index 2730d93e0..678d8269b 100644
--- a/crypto/src/cms/DefaultAuthenticatedAttributeTableGenerator.cs
+++ b/crypto/src/cms/DefaultAuthenticatedAttributeTableGenerator.cs
@@ -1,9 +1,9 @@
 using System;
 using System.Collections;
+using System.Collections.Generic;
 
 using Org.BouncyCastle.Asn1;
 using Org.BouncyCastle.Asn1.Cms;
-using Org.BouncyCastle.Utilities;
 
 namespace Org.BouncyCastle.Cms
 {
@@ -13,14 +13,14 @@ namespace Org.BouncyCastle.Cms
 	public class DefaultAuthenticatedAttributeTableGenerator
 		: CmsAttributeTableGenerator
 	{
-		private readonly IDictionary table;
+		private readonly IDictionary<DerObjectIdentifier, object> m_table;
 
 		/**
 		 * Initialise to use all defaults
 		 */
 		public DefaultAuthenticatedAttributeTableGenerator()
 		{
-			table =  Platform.CreateHashtable();
+			m_table = new Dictionary<DerObjectIdentifier, object>();
 		}
 
 		/**
@@ -33,11 +33,11 @@ namespace Org.BouncyCastle.Cms
 		{
 			if (attributeTable != null)
 			{
-				table = attributeTable.ToDictionary();
+				m_table = attributeTable.ToDictionary();
 			}
 			else
 			{
-				table = Platform.CreateHashtable();
+				m_table = new Dictionary<DerObjectIdentifier, object>();
 			}
 		}
 
@@ -51,12 +51,12 @@ namespace Org.BouncyCastle.Cms
 		 *
 		 * @return a filled in IDictionary of attributes.
 		 */
-		protected virtual IDictionary CreateStandardAttributeTable(
+		protected virtual IDictionary<DerObjectIdentifier, object> CreateStandardAttributeTable(
 			IDictionary parameters)
 		{
-            IDictionary std = Platform.CreateHashtable(table);
+            var std = new Dictionary<DerObjectIdentifier, object>(m_table);
 
-			if (!std.Contains(CmsAttributes.ContentType))
+			if (!std.ContainsKey(CmsAttributes.ContentType))
             {
                 DerObjectIdentifier contentType = (DerObjectIdentifier)
                     parameters[CmsAttributeTableParameter.ContentType];
@@ -65,7 +65,7 @@ namespace Org.BouncyCastle.Cms
                 std[attr.AttrType] = attr;
             }
 
-			if (!std.Contains(CmsAttributes.MessageDigest))
+			if (!std.ContainsKey(CmsAttributes.MessageDigest))
             {
                 byte[] messageDigest = (byte[])parameters[CmsAttributeTableParameter.Digest];
                 Asn1.Cms.Attribute attr = new Asn1.Cms.Attribute(CmsAttributes.MessageDigest,
@@ -76,14 +76,13 @@ namespace Org.BouncyCastle.Cms
             return std;
 		}
 
-        /**
+		/**
 		 * @param parameters source parameters
 		 * @return the populated attribute table
 		 */
-		public virtual AttributeTable GetAttributes(
-			IDictionary parameters)
+		public virtual AttributeTable GetAttributes(IDictionary parameters)
 		{
-            IDictionary table = CreateStandardAttributeTable(parameters);
+            var table = CreateStandardAttributeTable(parameters);
 			return new AttributeTable(table);
 		}
 	}