2 * ============LICENSE_START=======================================================
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
23 package org.openecomp.sparky.security;
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;
34 import javax.net.ssl.SSLContext;
37 * A factory for creating SecurityContext objects.
39 public interface SecurityContextFactory {
41 public String getSslAlgorithm();
43 public void setSslAlgorithm(String sslAlgorithm);
45 public String getKeyManagerAlgortihm();
47 public void setKeyManagerAlgortihm(String keyManagerAlgortihm);
49 public String getKeyStoreType();
51 public void setKeyStoreType(String keyStoreType);
53 public boolean isServerCertificationChainValidationEnabled();
55 public void setServerCertificationChainValidationEnabled(
56 boolean serverCertificationChainValidationEnabled);
58 public String getTrustStoreFileName();
60 public void setTrustStoreFileName(String filename);
62 public String getClientCertPassword();
64 public void setClientCertPassword(String password);
66 public void setClientCertFileInputStream(FileInputStream fis);
68 public void setClientCertFileName(String filename) throws IOException;
70 public FileInputStream getClientCertFileInputStream();
72 public SSLContext getSecureContext()
73 throws KeyManagementException, NoSuchAlgorithmException, FileNotFoundException,
74 KeyStoreException, CertificateException, IOException, UnrecoverableKeyException;