Use dynamic certificates
[dmaap/dbcapi.git] / src / main / java / org / onap / dmaap / dbcapi / server / CertificateManager.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * org.onap.dmaap
4  * ================================================================================
5  * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.dmaap.dbcapi.server;
22
23 import org.onap.dmaap.dbcapi.logging.BaseLoggingClass;
24
25 public abstract class CertificateManager extends BaseLoggingClass{
26         
27         class cmAttribute {
28                 private String type;
29                 private String file;
30                 private String password;
31                 
32                 private String getType() {
33                         return type;
34                 }
35                 private void setType(String certificateType) {
36                         this.type = certificateType;
37                 }
38                 private String getFile() {
39                         return file;
40                 }
41                 private void setFile(String keyStoreFile) {
42                         this.file = keyStoreFile;
43                 }
44                 private void setPassword( String pwd ) {
45                         this.password = pwd;
46                 }
47                 private String getPassword() {
48                         return password;
49                 }
50         }
51
52         private cmAttribute keyStore;
53         private cmAttribute     trustStore;
54         protected boolean ready;
55
56         public boolean isReady() {
57                 return ready;
58         }
59         
60         public String getKeyStoreType() {
61                 return keyStore.getType();
62         }
63         public void setKeyStoreType(String certificateType) {
64                 this.keyStore.setType( certificateType) ;
65         }
66         public String getKeyStoreFile() {
67                 return keyStore.getFile();
68         }
69         public void setKeyStoreFile(String keyStoreFile) {
70                 this.keyStore.setFile(keyStoreFile);
71         }
72
73         public String getKeyStorePassword() {
74                 return keyStore.getPassword();
75         }
76         public void setKeyStorePassword(String keyStorePassword) {
77                 this.keyStore.setPassword(keyStorePassword);
78         }
79         public String getTrustStoreType() {
80                 return trustStore.getType();
81         }
82         public void setTrustStoreType( String type ) {
83                 this.trustStore.setType(type);
84         }
85         public String getTrustStoreFile() {
86                 return trustStore.getFile();
87         }
88         public void setTrustStoreFile(String trustStoreFile) {
89                 this.trustStore.setFile(trustStoreFile);
90         }
91         public String getTrustStorePassword() {
92                 return trustStore.getPassword();
93         }
94         public void setTrustStorePassword(String trustStorePassword) {
95                 this.trustStore.setPassword(trustStorePassword);
96         }
97
98 }