diff options
Diffstat (limited to 'src/main/java/org/bouncycastle/asn1/x500/style/IETFUtils.java')
-rw-r--r-- | src/main/java/org/bouncycastle/asn1/x500/style/IETFUtils.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/java/org/bouncycastle/asn1/x500/style/IETFUtils.java b/src/main/java/org/bouncycastle/asn1/x500/style/IETFUtils.java index 0cbad08e..c73107eb 100644 --- a/src/main/java/org/bouncycastle/asn1/x500/style/IETFUtils.java +++ b/src/main/java/org/bouncycastle/asn1/x500/style/IETFUtils.java @@ -1,6 +1,7 @@ package org.bouncycastle.asn1.x500.style; import java.io.IOException; +import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; @@ -228,6 +229,34 @@ public class IETFUtils return tmp; } + public static String[] findAttrNamesForOID( + ASN1ObjectIdentifier oid, + Hashtable lookup) + { + int count = 0; + for (Enumeration en = lookup.elements(); en.hasMoreElements();) + { + if (oid.equals(en.nextElement())) + { + count++; + } + } + + String[] aliases = new String[count]; + count = 0; + + for (Enumeration en = lookup.keys(); en.hasMoreElements();) + { + String key = (String)en.nextElement(); + if (oid.equals(lookup.get(key))) + { + aliases[count++] = key; + } + } + + return aliases; + } + public static ASN1ObjectIdentifier decodeAttrName( String name, Hashtable lookUp) |