View Javadoc

1   /* 
2    * Copyright (c) 2007, Fraunhofer-Gesellschaft
3    * All rights reserved.
4    * 
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions are
7    * met:
8    * 
9    * (1) Redistributions of source code must retain the above copyright
10   *     notice, this list of conditions and the disclaimer at the end.
11   *     Redistributions in binary form must reproduce the above copyright
12   *     notice, this list of conditions and the following disclaimer in
13   *     the documentation and/or other materials provided with the
14   *     distribution.
15   * 
16   * (2) Neither the name of Fraunhofer nor the names of its
17   *     contributors may be used to endorse or promote products derived
18   *     from this software without specific prior written permission.
19   * 
20   * DISCLAIMER
21   * 
22   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25   * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26   * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29   * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30   * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33   *  
34   */
35  package org.ogf.graap.wsag.api.security;
36  
37  import org.ogf.graap.wsag4j.types.configuration.WSRFEngineConfigurationType;
38  
39  /**
40   * KeystoreProperties
41   * 
42   * @author Oliver Waeldrich
43   * 
44   */
45  public class KeystoreProperties
46  {
47  
48      private String keyStoreType = "JKS";
49  
50      private String keystoreFilename;
51  
52      private String keystorePassword;
53  
54      private String keyStoreAlias = "";
55  
56      private String privateKeyPassword;
57  
58      private String truststoreType = "JKS";
59  
60      private String truststoreFilename;
61  
62      private String truststorePassword;
63  
64      /**
65       * default constructor
66       */
67      public KeystoreProperties()
68      {
69          super();
70      }
71  
72      /**
73       * Creates a new {@link KeystoreProperties} instance based on a given WSRF engine configuration.
74       * 
75       * @param configuration
76       *            the WSRF engine configuration to use
77       */
78      public KeystoreProperties( WSRFEngineConfigurationType configuration )
79      {
80          super();
81  
82          keyStoreType = configuration.getKeystore().getKeystoreType();
83          keystoreFilename = configuration.getKeystore().getKeystoreFile();
84          keystorePassword = configuration.getKeystore().getKeystorePassword();
85          keyStoreAlias = configuration.getKeystore().getAlias();
86          privateKeyPassword = configuration.getKeystore().getAliasPassword();
87  
88          truststoreType = configuration.getTruststore().getTruststoreType();
89          truststoreFilename = configuration.getTruststore().getTruststoreFile();
90          truststorePassword = configuration.getTruststore().getTruststorePassword();
91      }
92  
93      /**
94       * @return the keyStoreType
95       */
96      public String getKeyStoreType()
97      {
98          return keyStoreType;
99      }
100 
101     /**
102      * @param keyStoreType
103      *            the keyStoreType to set
104      */
105     public void setKeyStoreType( String keyStoreType )
106     {
107         this.keyStoreType = keyStoreType;
108     }
109 
110     /**
111      * @return the keystoreFilename
112      */
113     public String getKeystoreFilename()
114     {
115         return keystoreFilename;
116     }
117 
118     /**
119      * @param keystoreFilename
120      *            the keystoreFilename to set
121      */
122     public void setKeystoreFilename( String keystoreFilename )
123     {
124         this.keystoreFilename = keystoreFilename;
125     }
126 
127     /**
128      * @return the keystorePassword
129      */
130     public String getKeystorePassword()
131     {
132         return keystorePassword;
133     }
134 
135     /**
136      * @param keystorePassword
137      *            the keystorePassword to set
138      */
139     public void setKeystorePassword( String keystorePassword )
140     {
141         this.keystorePassword = keystorePassword;
142     }
143 
144     /**
145      * @return the keyStoreAlias
146      */
147     public String getKeyStoreAlias()
148     {
149         return keyStoreAlias;
150     }
151 
152     /**
153      * @param keyStoreAlias
154      *            the keyStoreAlias to set
155      */
156     public void setKeyStoreAlias( String keyStoreAlias )
157     {
158         this.keyStoreAlias = keyStoreAlias;
159     }
160 
161     /**
162      * @return the privateKeyPassword
163      */
164     public String getPrivateKeyPassword()
165     {
166         return privateKeyPassword;
167     }
168 
169     /**
170      * @param privateKeyPassword
171      *            the privateKeyPassword to set
172      */
173     public void setPrivateKeyPassword( String privateKeyPassword )
174     {
175         this.privateKeyPassword = privateKeyPassword;
176     }
177 
178     /**
179      * @return the truststoreType
180      */
181     public String getTruststoreType()
182     {
183         return truststoreType;
184     }
185 
186     /**
187      * @param truststoreType
188      *            the truststoreType to set
189      */
190     public void setTruststoreType( String truststoreType )
191     {
192         this.truststoreType = truststoreType;
193     }
194 
195     /**
196      * @return the truststoreFilename
197      */
198     public String getTruststoreFilename()
199     {
200         return truststoreFilename;
201     }
202 
203     /**
204      * @param truststoreFilename
205      *            the truststoreFilename to set
206      */
207     public void setTruststoreFilename( String truststoreFilename )
208     {
209         this.truststoreFilename = truststoreFilename;
210     }
211 
212     /**
213      * @return the truststorePassword
214      */
215     public String getTruststorePassword()
216     {
217         return truststorePassword;
218     }
219 
220     /**
221      * @param truststorePassword
222      *            the truststorePassword to set
223      */
224     public void setTruststorePassword( String truststorePassword )
225     {
226         this.truststorePassword = truststorePassword;
227     }
228 
229 }