Changing the license and trademark
[aai/sparky-be.git] / src / main / java / org / openecomp / sparky / security / SecurityContextFactory.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6  * Copyright © 2017 Amdocs
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *       http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  *
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  */
23 package org.openecomp.sparky.security;
24
25 import java.io.FileInputStream;
26 import java.io.FileNotFoundException;
27 import java.io.IOException;
28 import java.security.KeyManagementException;
29 import java.security.KeyStoreException;
30 import java.security.NoSuchAlgorithmException;
31 import java.security.UnrecoverableKeyException;
32 import java.security.cert.CertificateException;
33
34 import javax.net.ssl.SSLContext;
35
36 /**
37  * A factory for creating SecurityContext objects.
38  */
39 public interface SecurityContextFactory {
40
41   public String getSslAlgorithm();
42
43   public void setSslAlgorithm(String sslAlgorithm);
44
45   public String getKeyManagerAlgortihm();
46
47   public void setKeyManagerAlgortihm(String keyManagerAlgortihm);
48
49   public String getKeyStoreType();
50
51   public void setKeyStoreType(String keyStoreType);
52
53   public boolean isServerCertificationChainValidationEnabled();
54
55   public void setServerCertificationChainValidationEnabled(
56       boolean serverCertificationChainValidationEnabled);
57
58   public String getTrustStoreFileName();
59
60   public void setTrustStoreFileName(String filename);
61
62   public String getClientCertPassword();
63
64   public void setClientCertPassword(String password);
65
66   public void setClientCertFileInputStream(FileInputStream fis);
67
68   public void setClientCertFileName(String filename) throws IOException;
69
70   public FileInputStream getClientCertFileInputStream();
71
72   public SSLContext getSecureContext()
73       throws KeyManagementException, NoSuchAlgorithmException, FileNotFoundException,
74       KeyStoreException, CertificateException, IOException, UnrecoverableKeyException;
75
76 }