KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejbca > core > model > ca > caadmin > extendedcaservices > OCSPCAServiceRequest


1 /*************************************************************************
2  * *
3  * EJBCA: The OpenSource Certificate Authority *
4  * *
5  * This software is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU Lesser General Public *
7  * License as published by the Free Software Foundation; either *
8  * version 2.1 of the License, or any later version. *
9  * *
10  * See terms of license at gnu.org. *
11  * *
12  *************************************************************************/

13  
14 package org.ejbca.core.model.ca.caadmin.extendedcaservices;
15
16 import java.io.Serializable JavaDoc;
17 import java.security.PrivateKey JavaDoc;
18 import java.util.ArrayList JavaDoc;
19 import java.util.List JavaDoc;
20
21 import org.apache.log4j.Logger;
22 import org.bouncycastle.asn1.x509.X509Extensions;
23 import org.bouncycastle.ocsp.OCSPReq;
24
25 /**
26  * Class used when requesting OCSP related services from a CA.
27  *
28  * @version $Id: OCSPCAServiceRequest.java,v 1.3 2006/12/20 17:15:48 anatom Exp $
29  */

30 public class OCSPCAServiceRequest extends ExtendedCAServiceRequest implements Serializable JavaDoc {
31     
32     public static final Logger m_log = Logger.getLogger(OCSPCAServiceRequest.class);
33     
34     private OCSPReq req = null;
35     private ArrayList JavaDoc responseList = null;
36     private X509Extensions exts = null;
37     private String JavaDoc sigAlg = "SHA1WithRSA";
38     private boolean useCACert = false;
39     private boolean includeChain = true;
40     private String JavaDoc privKeyProvider = "BC"; // Default for OCSP responder not using the CAs private key
41

42     // Parameters that are used when we use the CAs private key to sign responses
43
private PrivateKey JavaDoc privKey = null;
44     private List JavaDoc certificateChain = null;
45     
46     /** Constructor for OCSPCAServiceRequest
47      */

48     public OCSPCAServiceRequest(OCSPReq req, ArrayList JavaDoc responseList, X509Extensions exts, String JavaDoc sigAlg, boolean useCACert, boolean includeChain) {
49         this.req = req;
50         this.responseList = responseList;
51         this.exts = exts;
52         this.sigAlg = sigAlg;
53         this.useCACert = useCACert;
54         this.includeChain = includeChain;
55     }
56     public OCSPReq getOCSPrequest() {
57         return req;
58     }
59     public X509Extensions getExtensions() {
60         return exts;
61     }
62     public ArrayList JavaDoc getResponseList() {
63         return responseList;
64     }
65     public String JavaDoc getSigAlg() {
66         return sigAlg;
67     }
68     /** If true, the CA certificate should be used to sign the OCSP response.
69      *
70      * @return true if the CA cert should be used, false if the OCSPSigner cert shoudl be used.
71      */

72     public boolean useCACert() {
73         return useCACert;
74     }
75     /** If true, the CA certificate chain is included in the response.
76      *
77      * @return true if the CA cert chain should be included in the response.
78      */

79     public boolean includeChain() {
80         return includeChain;
81     }
82     /** Used when the CA passes a certificate chain for use when signing with the CAs signature key
83      *
84      * @return List with certificates or null, if another chain should be used
85      */

86     public List JavaDoc getCertificateChain() {
87         return certificateChain;
88     }
89     public void setCertificateChain(List JavaDoc certificatechain) {
90         this.certificateChain = certificatechain;
91     }
92     /** Used when the CA passes a private key (reference) for use when signing with the CAs signature key
93      *
94      * @return private key or null, if another private key should be used
95      */

96     public PrivateKey JavaDoc getPrivKey() {
97         return privKey;
98     }
99     public void setPrivKey(PrivateKey JavaDoc privKey) {
100         this.privKey = privKey;
101     }
102     public String JavaDoc getPrivKeyProvider() {
103         return privKeyProvider;
104     }
105     public void setPrivKeyProvider(String JavaDoc privKeyProvider) {
106         this.privKeyProvider = privKeyProvider;
107     }
108 }
109
Popular Tags