summary refs log tree commit diff
path: root/crypto/src/util/collections
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2018-09-14 17:54:02 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2018-09-14 17:54:02 +0700
commit297ccc3cc304defd9ecb0ba944bede4f89696b3b (patch)
treecd76cba6a46d74fa58a4b07af0221040840a3ce7 /crypto/src/util/collections
parentRFC 8032: Implement Ed25519ctx, Ed25519ph, Ed448ph variants (diff)
downloadBouncyCastle.NET-ed25519-297ccc3cc304defd9ecb0ba944bede4f89696b3b.tar.xz
RFC 5958: Update PrivateKeyInfo
- now supports optional 'publicKey' field
Diffstat (limited to 'crypto/src/util/collections')
-rw-r--r--crypto/src/util/collections/CollectionUtilities.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/src/util/collections/CollectionUtilities.cs b/crypto/src/util/collections/CollectionUtilities.cs
index 18fcb6774..cac158226 100644
--- a/crypto/src/util/collections/CollectionUtilities.cs
+++ b/crypto/src/util/collections/CollectionUtilities.cs
@@ -39,6 +39,14 @@ namespace Org.BouncyCastle.Utilities.Collections
             return new UnmodifiableSetProxy(s);
         }
 
+        public static object RequireNext(IEnumerator e)
+        {
+            if (!e.MoveNext())
+                throw new InvalidOperationException();
+
+            return e.Current;
+        }
+
         public static string ToString(IEnumerable c)
         {
             StringBuilder sb = new StringBuilder("[");