The oracle.security.crypto.cert.X500RDN Class The oracle.security.crypto.cert.X500Name Class

Oracle Security Engine 4-3 5. Add the full path and file names for all of the required jar and class files to the CLASSPATH. For example, your CLASSPATH might look like this: CLASSPATH; ORACLE_HOME\modules\oracle.osdt_11.1.1\osdt_core.jar; ORACLE_HOME\modules\oracle.osdt_11.1.1\osdt_cert.jar; 6. Click OK.

4.2.2.2 Setting the CLASSPATH on UNIX

To set your CLASSPATH on UNIX, set your CLASSPATH environment variable to include the full path and file name of all of the required jar and class files. For example: setenv CLASSPATH CLASSPATH: ORACLE_HOMEmodulesoracle.osdt_11.1.1osdt_core.jar: ORACLE_HOMEmodulesoracle.osdt_11.1.1osdt_cert.jar:

4.3 Core Classes and Interfaces

This section provides information and code samples for using the certificate facility classes of Oracle Security Engine. Oracle Security Engine also includes all of the classes provided with Oracle Crypto. See Chapter 3, Oracle Crypto for an overview of the core Oracle Crypto classes. Class Changes in OracleAS 11gR1 In OracleAS 11gR1, the oracle.security.crypto.cert.X509 class for certificate management has been replaced with java.security.cert.X509Certificate The Core Certificate Classes The core certificate facility classes are: ■ The oracle.security.crypto.cert.X500RDN Class ■ The oracle.security.crypto.cert.X500Name Class ■ The oracle.security.crypto.cert.CertificateRequest Class ■ The java.security.cert.X509Certificate Class

4.3.1 The oracle.security.crypto.cert.X500RDN Class

This class represents an X.500 Relative Distinguished Name RDN. This is the building block for X.500 names. A RDN consists of a set of attribute-value pairs. Typically, there is a single attribute-value pair in each RDN. Example 4–1 Code Example for Creating and Retrieving an X500RDN Object Create the X500RDN object X500RDN rdn = new X500RDNPKIX.id_at_commonName, Joe Smith; Retrieve the value X500Name n = Instance of oracle.security.crypto.cert.X500Name; String name = n.getAttributePKIX.id_at_commonName.getValue.getValue; 4-4 Oracle Fusion Middleware Reference for Oracle Security Developer Tools

4.3.2 The oracle.security.crypto.cert.X500Name Class

This class represents distinguished names as used in the X.500 series of specifications, defined in X.520. An X500Name object is made of X500RDN objects. An X500Name holds attributes defining an entity such as the common name, country, organization, and so on. To create an X500Name object, use the standard constructor and then populate the object with attributes. Once created, the object can then be DER-encoded to make it available to other processes: Example 4–2 Code Example for Creating an X500Name Object X500Name name = new X500Name; name.addComponentPKIX.id_at_commonName, Joe Smith; name.addComponentPKIX.id_at_countryName, USA; name.addComponentPKIX.id_at_stateOrProvinceName, NY; name.addComponentPKIX.id_at_localityName, New York; name.addComponentPKIX.id_at_organizationName, Oracle; name.addComponentPKIX.id_at_organizationalUnitName, Engineering; name.addComponentPKIX.emailAddress, joe.smithoracle.com; Make object DER-encoded so its available to other processes byte[] encodedName = Utils.toBytesname; X500Name n = new X500Namenew ByteArrayInputStreamencodedName; String name = n.getAttributePKIX.id_at_commonName.getValue.getValue; String email = n.getAttributePKIX.emailAddress.getValue.getValue;

4.3.3 The oracle.security.crypto.cert.CertificateRequest Class