oracle.security.xmlsec.xkms.xkiss.LocateRequest oracle.security.xmlsec.xkms.xkiss.LocateResult

Oracle XKMS 12-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: C:ORACLE_HOME\modules\oracle.osdt_11.1.1\osdt_core.jar; ORACLE_HOME\modules\oracle.osdt_11.1.1\osdt_cert.jar; ORACLE_HOME\modules\oracle.osdt_11.1.1\osdt_xmlsec.jar; ORACLE_HOME\modules\org.jaxen_1.1.1.jar;

6. Click OK.

12.2.2.2 Setting the CLASSPATH on UNIX

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: ORACLE_HOMEmodulesoracle.osdt_11.1.1osdt_xmlsec.jar ORACLE_HOME\modules\org.jaxen_1.1.1.jar;

12.3 Core Classes and Interfaces

This section provides information and code samples for using the key classes and interfaces of Oracle XKMS. The core classes are: ■ oracle.security.xmlsec.xkms.xkiss.LocateRequest ■ oracle.security.xmlsec.xkms.xkiss.LocateResult ■ oracle.security.xmlsec.xkms.xkiss.ValidateRequest ■ oracle.security.xmlsec.xkms.xkiss.ValidateResult ■ oracle.security.xmlsec.xkms.xkrss.RecoverRequest ■ oracle.security.xmlsec.xkms.xkrss.RecoverResult

12.3.1 oracle.security.xmlsec.xkms.xkiss.LocateRequest

This class represents the XKMS LocateRequest element. Example 12–1 shows how to create an instance of LocateRequest: Example 12–1 Creating an Instance of LocateRequest Parse the XML document containing the dsig:Signature. Document sigDoc = Instance of org.w3c.dom.Document; Create Query Key Binding QueryKeyBinding queryKeyBinding = new QueryKeyBindingsigDoc; queryKeyBinding.setTimeInstantnew Date; Create the xkms:LocateRequest. LocateRequest loc = new LocateRequestsigDoc, queryKeyBinding; Client requests of type LocateRequest must include an xkms:RespondWith attribute. Example 12–2 shows how RespondWith can be added to a LocateRequest: 12-4 Oracle Fusion Middleware Reference for Oracle Security Developer Tools Example 12–2 Adding RespondWith to a LocateRequest Add xkms:RespondWith as X.509 Certificate. loc.addRespondWithXKMSURI.respondWith_X509Cert;

12.3.2 oracle.security.xmlsec.xkms.xkiss.LocateResult

This class represents the xkms:LocateResult element. Example 12–3 shows how to create an instance of LocateResult: Example 12–3 Creating an Instance of LocateResult Parse the XML document containin the dsig:Signature Document sigDoc = Instance of org.w3c.doc.Document; Create the xkms:LocateResult LocateResult locRes = new LocateResultsigDoc; Set ResultMajor to Success. locRes.setResultCodeXKMSURI.result_major_success, null; If the LocateRequest contained a RespondWith attribute of X509Certificate, use the following code to add an X509 Certificate to the LocateResult: Example 12–4 Adding an X509 Certificate to LocateResult Creating a signature and adding X509 certificate to the KeyInfo element. X509Certificate userCert = Instance of java.security.cert.X509Certificate XSSignature Sig = XSSignature.newInstancesigDoc, MySignature; XSKeyInfo xsInfo = sig.getKeyInfo; X509Data xData = xsInfo.createX509DatauserCert; Add X509Data to the KeyInfo xsInfo.addKeyInfoDataxData; Set Key Binding and add KeyInfo the the KeyBinding UnverifiedKeyBinding keyBinding = new UnverifiedKeyBindingsigDoc; keyBinding.setKeyInfoxsInfo; Add Key Binding to LocateResult locRes.addKeyBindingkeyBinding;

12.3.3 oracle.security.xmlsec.xkms.xkiss.ValidateRequest