Skip navigation links

Oracle Fusion Middleware Crypto FIPS Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10696-05


oracle.security.crypto.util
Class OIDManager

java.lang.Object
  extended by oracle.security.crypto.util.OIDManager


public final class OIDManager
extends java.lang.Object

A class to manage mappings between object identifiers and the classes that implement them.


Field Summary
protected  OIDManager parent
           

 

Constructor Summary
OIDManager()
          Creates a new OIDManager.
OIDManager(OIDManager parent)
          Creates a new OIDManager whose parent in the chain is specified by the argument.

 

Method Summary
 java.lang.String getAttributeName(ASN1ObjectID oid)
          Returns the String to which the given attribute type is mapped, for the first OIDManager encountered in the chain that maps the attribute type.
 ASN1ObjectID getAttributeType(java.lang.String name)
          Returns the OID to which the given attribute type name is mapped, for the first OIDManager encountered in the chain that maps the attribute type name.
 java.lang.Class<?> getMapping(ASN1ObjectID oid, java.lang.String key)
          Returns the value to which the specified key is mapped for the specified OID, for the first OIDManager encountered in the chain that maps the OID and key.
 java.util.Hashtable<java.lang.String,java.lang.Class<?>> getMappings(ASN1ObjectID oid)
          Deprecated. Use getMappingsAsMap(ASN1ObjectID)
 java.util.Map<java.lang.String,java.lang.Class<?>> getMappingsAsMap(ASN1ObjectID oid)
          Returns the Map object to which the given OID is mapped, for the first OIDManager encountered in the chain that maps the OID.
static OIDManager getOIDManager()
          Gets the system-wide OIDManager.
 void load(java.io.InputStream is)
          Loads OID and Properties mappings for this OIDManager from the specified input stream.
 ASN1ObjectID setAttributeTypeName(java.lang.String name, ASN1ObjectID oid)
           
 java.lang.Class<?> setMapping(ASN1ObjectID oid, java.lang.String key, java.lang.Class<?> classObject)
          Maps the specified key to the specified value in the Hashtable object for the given OID for this OIDManager.
 java.util.Hashtable<java.lang.String,java.lang.Class<?>> setMappings(ASN1ObjectID oid, java.util.Hashtable<java.lang.String,java.lang.Class<?>> table)
          Deprecated. use setMappings(ASN1ObjectID, Map)
 java.util.Map<java.lang.String,java.lang.Class<?>> setMappings(ASN1ObjectID oid, java.util.Map<java.lang.String,java.lang.Class<?>> table)
          Maps the given OID to the given Map object for this OIDManager.
static void setOIDManager(OIDManager om)
          Sets the system-wide OIDManager.
static void writeProperties(java.util.Properties props, java.io.OutputStream out, java.lang.String header)
          Writes the given java.util.Properties to the given output stream, but does not insert a comment containing the current date/time (as the Properties.save method does).

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

parent

protected OIDManager parent

Constructor Detail

OIDManager

public OIDManager()
Creates a new OIDManager.

OIDManager

public OIDManager(OIDManager parent)
Creates a new OIDManager whose parent in the chain is specified by the argument.
Parameters:
parent - the parent in the OIDManager chain.

Method Detail

setOIDManager

public static void setOIDManager(OIDManager om)
Sets the system-wide OIDManager. Only one OIDManager may be in effect at a given time (in addition to the default OIDManager).
Parameters:
om - the OIDManager to be set.

getOIDManager

public static OIDManager getOIDManager()
Gets the system-wide OIDManager.
Returns:
the current system-wide OIDManager, or the default OIDManager if none has been set using the setOIDManager method.

setMappings

public java.util.Hashtable<java.lang.String,java.lang.Class<?>> setMappings(ASN1ObjectID oid,
                                                                            java.util.Hashtable<java.lang.String,java.lang.Class<?>> table)
Deprecated. use setMappings(ASN1ObjectID, Map)
Maps the given OID to the given Hashtable object for this OIDManager.
Parameters:
oid - the OID to map to the specified Hashtable.
table - the Hashtable to which the specified OID is to be mapped.
Returns:
the previously mapped Hashtable object, or null if no mapping was defined for this OIDManager.

setMappings

public java.util.Map<java.lang.String,java.lang.Class<?>> setMappings(ASN1ObjectID oid,
                                                                      java.util.Map<java.lang.String,java.lang.Class<?>> table)
Maps the given OID to the given Map object for this OIDManager.
Parameters:
oid - the OID to map to the specified Map.
table - the Map to which the specified OID is to be mapped.
Returns:
the previously mapped Map object, or null if no mapping was defined for this OIDManager.

getMappings

public java.util.Hashtable<java.lang.String,java.lang.Class<?>> getMappings(ASN1ObjectID oid)
Deprecated. Use getMappingsAsMap(ASN1ObjectID)
Returns the Hashtable object to which the given OID is mapped, for the first OIDManager encountered in the chain that maps the OID.
Parameters:
oid - the OID mapped to the Hashtable.
Returns:
the mapped Hashtable object, or null if no mapping is defined.

getMappingsAsMap

public java.util.Map<java.lang.String,java.lang.Class<?>> getMappingsAsMap(ASN1ObjectID oid)
Returns the Map object to which the given OID is mapped, for the first OIDManager encountered in the chain that maps the OID.
Parameters:
oid - the OID mapped to the Map.
Returns:
the mapped Map object, or null if no mapping is defined.

setMapping

public java.lang.Class<?> setMapping(ASN1ObjectID oid,
                                     java.lang.String key,
                                     java.lang.Class<?> classObject)
Maps the specified key to the specified value in the Hashtable object for the given OID for this OIDManager.
Parameters:
oid - the OID mapped to the Hashtable to which the specified key-value pair is to be added.
key - the key to be mapped to the specified value.
value - the value to which the specified key is to be mapped.
Returns:
the previously mapped value, or null if no mapping was defined for this OIDManager.
See Also:
getAttributeType(java.lang.String)

getMapping

public java.lang.Class<?> getMapping(ASN1ObjectID oid,
                                     java.lang.String key)
Returns the value to which the specified key is mapped for the specified OID, for the first OIDManager encountered in the chain that maps the OID and key.
Parameters:
oid - the OID mapped to the Hashtable in which the specified key is to be looked up.
key - the key for the class to be looked up.
Returns:
the mapped Class, or null if no mapping is defined.

setAttributeTypeName

public ASN1ObjectID setAttributeTypeName(java.lang.String name,
                                         ASN1ObjectID oid)

getAttributeType

public ASN1ObjectID getAttributeType(java.lang.String name)
Returns the OID to which the given attribute type name is mapped, for the first OIDManager encountered in the chain that maps the attribute type name.
Parameters:
name - the mapped attribute type name.
Returns:
the mapped OID, or null if no mapping is defined.

getAttributeName

public java.lang.String getAttributeName(ASN1ObjectID oid)
Returns the String to which the given attribute type is mapped, for the first OIDManager encountered in the chain that maps the attribute type.
Parameters:
oid - the mapped attribute type.
Returns:
the mapped name, or null if no mapping is defined.

load

public void load(java.io.InputStream is)
          throws java.io.IOException
Loads OID and Properties mappings for this OIDManager from the specified input stream. OIDManagers further up the chain are unaffected.

Each OID occupies one line of the input stream. The OID must be preceded on the line by an ASCII & (surrounded and/or separated by zero or more whitespace characters).

Each line is terminated by a line terminator (\n or \r or \r\n). Lines from the input stream are processed until end of file is reached on the input stream.

A line that contains only whitespace or whose first non- whitespace character is an ASCII # or ! is ignored (thus, # or ! indicate comment lines). An ampersand included in a comment line must be represented by its escaped unicode value /u0026.

Each OID line is followed by its Properties definition, using the syntax set forth in the javadoc for java.util.Properties.load(java.io.InputStream).

As an example, the following lines specify the Properties to which the AlgID.rsaEncryption OID is mapped:

    & 1.2.840.113549.1.1.1
    privateKey = oracle.security.crypto.core.RSAPrivateKey
    publicKey = oracle.security.crypto.core.RSAPublicKey
    useSignature = oracle.security.crypto.core.RSAMDSignature
    keyPairGenerator = oracle.security.crypto.core.RSAKeyPairGenerator
    cipher = oracle.security.crypto.core.RSApkcs1
 
Parameters:
is - the input stream from which the definitions are to be read.
Throws:
java.io.IOException

writeProperties

public static void writeProperties(java.util.Properties props,
                                   java.io.OutputStream out,
                                   java.lang.String header)
                            throws java.io.IOException
Writes the given java.util.Properties to the given output stream, but does not insert a comment containing the current date/time (as the Properties.save method does).
Throws:
java.io.IOException

Skip navigation links

Oracle Fusion Middleware Crypto FIPS Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10696-05


Copyright © 2005, 2013, Oracle. All rights reserved.