From 215cb54e4f7367ea450195f5678dc3d5d1385008 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Mon, 24 Jul 2023 13:05:28 +0700 Subject: Implement IEnumerable in CMS stores --- crypto/src/cms/RecipientInformationStore.cs | 13 ++++++++++++- crypto/src/cms/SignerInformationStore.cs | 11 +++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/crypto/src/cms/RecipientInformationStore.cs b/crypto/src/cms/RecipientInformationStore.cs index 281b51c79..e317bc381 100644 --- a/crypto/src/cms/RecipientInformationStore.cs +++ b/crypto/src/cms/RecipientInformationStore.cs @@ -6,6 +6,7 @@ using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Cms { public class RecipientInformationStore + : IEnumerable { private readonly IList m_all; private readonly IDictionary> m_table = @@ -81,5 +82,15 @@ namespace Org.BouncyCastle.Cms return new List(list); } - } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public virtual IEnumerator GetEnumerator() + { + return GetRecipients().GetEnumerator(); + } + } } diff --git a/crypto/src/cms/SignerInformationStore.cs b/crypto/src/cms/SignerInformationStore.cs index bc21f9d39..00919c221 100644 --- a/crypto/src/cms/SignerInformationStore.cs +++ b/crypto/src/cms/SignerInformationStore.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; namespace Org.BouncyCastle.Cms { public class SignerInformationStore + : IEnumerable { private readonly IList m_all; private readonly IDictionary> m_table = @@ -87,5 +88,15 @@ namespace Org.BouncyCastle.Cms return new List(0); } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public virtual IEnumerator GetEnumerator() + { + return GetSigners().GetEnumerator(); + } } } -- cgit 1.4.1