KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > install > forms > ImportExistingCertificateForm


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.install.forms;
21
22 import java.util.List JavaDoc;
23
24 import javax.servlet.http.HttpServletRequest JavaDoc;
25
26 import com.sslexplorer.boot.KeyStoreManager;
27 import com.sslexplorer.wizard.AbstractWizardSequence;
28 import com.sslexplorer.wizard.forms.DefaultWizardForm;
29
30 /**
31  * Form for importing existing certificate.
32  *
33  * @author James D Robinson <a HREF="mailto:james@3sp.com">&lt;james@3sp.com&gt;</a>
34  *
35  */

36 public class ImportExistingCertificateForm extends DefaultWizardForm {
37
38     /**
39      * Constant for passphrase.
40      */

41     public static final String JavaDoc ATTR_PASSPHRASE = "passphrase";
42     
43     /**
44      * Constant for the upload file.
45      */

46     public static final String JavaDoc ATTR_UPLOADED_FILE = "uploadedFile";
47     
48     /**
49      * Constant for the key store type.
50      */

51     public static final String JavaDoc ATTR_KEY_STORE_TYPE = "keyStoreType";
52     
53     /**
54      * Constant for alias.
55      */

56     public static final String JavaDoc ATTR_ALIAS = "alias";
57
58     // Private instance variables
59

60     private String JavaDoc keyStoreType;
61     private String JavaDoc alias;
62             
63     /**
64      * Constructor
65      */

66     public ImportExistingCertificateForm() {
67         super(true, true, "/WEB-INF/jsp/content/install/importExistingCertificate.jspf",
68             "password", false, false, "importExistingCertificate",
69             "install", "installation.importExistingCertificate", 1);
70     }
71     
72     /* (non-Javadoc)
73      * @see com.sslexplorer.wizard.forms.DefaultWizardForm#init(com.sslexplorer.wizard.AbstractWizardSequence, javax.servlet.http.HttpServletRequest)
74      */

75     public void init(AbstractWizardSequence wizardSequence, HttpServletRequest JavaDoc request) throws Exception JavaDoc {
76         super.init(wizardSequence, request);
77         keyStoreType = (String JavaDoc)wizardSequence.getAttribute(ATTR_KEY_STORE_TYPE, getAvailableKeyStoreTypes().get(0).toString());
78         alias = "";
79     }
80
81     /**
82      * @return List
83      */

84     public List JavaDoc getAvailableKeyStoreTypes() {
85         return KeyStoreManager.getInstance(KeyStoreManager.DEFAULT_KEY_STORE).getSupportedKeyStoreTypes();
86     }
87
88     /**
89      * @return String
90      */

91     public String JavaDoc getAlias() {
92         return alias;
93     }
94     
95     /**
96      * @param alias
97      */

98     public void setAlias(String JavaDoc alias) {
99         this.alias = alias;
100     }
101     
102     /**
103      * @return String
104      */

105     public String JavaDoc getKeyStoreType() {
106         return keyStoreType;
107     }
108     
109     /**
110      * @param keyStoreType
111      */

112     public void setKeyStoreType(String JavaDoc keyStoreType) {
113         this.keyStoreType = keyStoreType;
114     }
115
116     /* (non-Javadoc)
117      * @see com.sslexplorer.wizard.forms.AbstractWizardForm#getFormEncoding()
118      */

119     public String JavaDoc getFormEncoding() {
120         return "multipart/form-data";
121     }
122
123     /* (non-Javadoc)
124      * @see com.sslexplorer.wizard.forms.AbstractWizardForm#getNextOnClick()
125      */

126     public String JavaDoc getNextOnClick() {
127         return "uploadCertificate();";
128     }
129 }
130
Popular Tags