oracle.security.xmlsec.xkms.xkiss.ValidateRequest oracle.security.xmlsec.xkms.xkiss.ValidateResult

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

This class represents the XKMS xkms:ValidateRequest element. Example 12–5 shows how to create an instance of xkms:ValidateRequest: Example 12–5 Creating an Instance of ValidateRequest 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:ValidateRequest. Oracle XKMS 12-5 ValidateRequest validateReq = new ValidateRequestsigDoc, queryKeyBinding; Requests of type ValidateRequest must include an xkms:RespondWith attribute. Example 12–6 shows how to add RespondWith to a ValidateRequest: Example 12–6 Adding RespondWith to a ValidateRequest Add xkms:RespondWith as X.509 Certificate. validateReq.addRespondWithXKMSURI.respondWith_X509Cert;

12.3.4 oracle.security.xmlsec.xkms.xkiss.ValidateResult

This class represents the XKMS ValidateResult element. Example 12–7 shows how to create an instance of ValidateResult: Example 12–7 Creating an Instance of ValidateResult Parse the XML document containin the dsig:Signature Document sigDoc = Instance of org.w3c.doc.Document; Create the xkms:ValidateResult ValidateResult valRes = new ValidateResultsigDoc; Set ResultMajor to Success. valRes.setResultCodeXKMSURI.result_major_success, null; Use the following code to set a status in response to a ValidateRequest: Example 12–8 Setting a Response Status for a ValidateRequest Create a status element and add reasons. Status responseStatus = new StatussigDoc; responseStatus.addValidReasonXKMSURI.reasonCode_IssuerTrust; responseStatus.addValidReasonXKMSURI.reasonCode_RevocationStatus; responseStatus.addValidReasonXKMSURI.reasonCode_ValidityInterval; responseStatus.addValidReasonXKMSURI.reasonCode_Signature; Create a xkms:KeyBinding to add status and X509Data XSKeyInfo xsInfo = Instance of oracle.security.xmlsec.dsig.XSKeyInfo, which contains X509Data KeyBinding keyBinding = new KeyBindingsigDoc; keyBinding.setStatusresponseStatus; keyBinding.setKeyInfoxsInfo; Add the key binding to the ValidateResult. valRes.addKeyBindingkeyBinding;

12.3.5 oracle.security.xmlsec.xkms.xkrss.RecoverRequest