Class OIDMap


  • public class OIDMap
    extends java.lang.Object
    This class defines the mapping from OID & name to classes and vice versa. Used by CertificateExtensions & PKCS10 to get the java classes associated with a particular OID/name.
    Version:
    1.12
    Author:
    Amit Kapoor, Hemma Prafullchandra
    • Constructor Summary

      Constructors 
      Constructor Description
      OIDMap()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addAttribute​(java.lang.String className, java.lang.String oid, java.lang.String name)
      Add a name to lookup table.
      static void addClass​(java.lang.Class<? extends Extension> clazz)
      Add an extension to the OIDMap.
      static java.lang.Class<?> getClass​(java.lang.String name)
      Return the java class object associated with the user friendly name.
      static java.lang.Class<?> getClass​(ObjectIdentifier oid)
      Return the java class object associated with the object identifier..
      static java.lang.String getName​(ObjectIdentifier oid)
      Return user friendly name associated with the OID.
      static ObjectIdentifier getOID​(java.lang.String name)
      Return Object identifier for user friendly name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • EXTENSIONS_HOME

        public static final java.lang.String EXTENSIONS_HOME
        Location for where the OID/Classes maps are stored on the local system.
      • EXTENSIONS_OIDS

        public static final java.lang.String EXTENSIONS_OIDS
        File names for where OIDs and Classes are registered for V3 extensions.
        See Also:
        Constant Field Values
      • EXTENSIONS_CLASSES

        public static final java.lang.String EXTENSIONS_CLASSES
        See Also:
        Constant Field Values
      • EXT_KEY_USAGE_NAME

        public static final java.lang.String EXT_KEY_USAGE_NAME
        See Also:
        Constant Field Values
      • EXT_INHIBIT_ANY_POLICY_NAME

        public static final java.lang.String EXT_INHIBIT_ANY_POLICY_NAME
        See Also:
        Constant Field Values
    • Constructor Detail

      • OIDMap

        public OIDMap()
    • Method Detail

      • addClass

        public static void addClass​(java.lang.Class<? extends Extension> clazz)
        Add an extension to the OIDMap. Assumes existence of static OID and NAME fields with unique values.
      • addAttribute

        public static void addAttribute​(java.lang.String className,
                                        java.lang.String oid,
                                        java.lang.String name)
                                 throws java.security.cert.CertificateException
        Add a name to lookup table.
        Parameters:
        className - the name of the fully qualified class implementing the asn object.
        oid - the string representation of the object identifier for the class.
        name - the name of the attribute.
        Throws:
        java.security.cert.CertificateException - on errors.
      • getName

        public static java.lang.String getName​(ObjectIdentifier oid)
        Return user friendly name associated with the OID.
        Parameters:
        oid - the name of the object identifier to be returned.
        Returns:
        the user friendly name or null if no name is registered for this oid.
      • getOID

        public static ObjectIdentifier getOID​(java.lang.String name)
        Return Object identifier for user friendly name.
        Parameters:
        name - the user friendly name.
        Returns:
        the Object Identifier or null if no oid is registered for this name.
      • getClass

        public static java.lang.Class<?> getClass​(java.lang.String name)
                                           throws java.security.cert.CertificateException
        Return the java class object associated with the user friendly name.
        Parameters:
        name - the user friendly name.
        Throws:
        java.security.cert.CertificateException - if class cannot be instantiated.
      • getClass

        public static java.lang.Class<?> getClass​(ObjectIdentifier oid)
                                           throws java.security.cert.CertificateException
        Return the java class object associated with the object identifier..
        Parameters:
        oid - the name of the object identifier to be returned.
        Throws:
        java.security.cert.CertificateException - if class cannot be instatiated.