2 * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
9 package org.opendaylight.openflowjava.protocol.api.connection;
\r
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.KeystoreType;
\r
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType;
\r
15 * Class is used only for testing purposes - passwords are hardcoded
\r
16 * @author michal.polkorab
\r
18 public class TlsConfigurationImpl implements TlsConfiguration {
\r
20 private KeystoreType trustStoreType;
\r
21 private String trustStore;
\r
22 private KeystoreType keyStoreType;
\r
23 private String keyStore;
\r
24 private PathType keystorePathType;
\r
25 private PathType truststorePathType;
\r
28 * Default constructor
\r
29 * @param trustStoreType JKS or PKCS12
\r
30 * @param trustStore path to trustStore file
\r
31 * @param trustStorePathType truststore path type (classpath or path)
\r
32 * @param keyStoreType JKS or PKCS12
\r
33 * @param keyStore path to keyStore file
\r
34 * @param keyStorePathType keystore path type (classpath or path)
\r
36 public TlsConfigurationImpl(KeystoreType trustStoreType, String trustStore,
\r
37 PathType trustStorePathType, KeystoreType keyStoreType,
\r
38 String keyStore, PathType keyStorePathType) {
\r
39 this.trustStoreType = trustStoreType;
\r
40 this.trustStore = trustStore;
\r
41 this.truststorePathType = trustStorePathType;
\r
42 this.keyStoreType = keyStoreType;
\r
43 this.keyStore = keyStore;
\r
44 this.keystorePathType = keyStorePathType;
\r
48 public KeystoreType getTlsTruststoreType() {
\r
49 return trustStoreType;
\r
53 public String getTlsTruststore() {
\r
58 public KeystoreType getTlsKeystoreType() {
\r
59 return keyStoreType;
\r
63 public String getTlsKeystore() {
\r
68 public PathType getTlsKeystorePathType() {
\r
69 return keystorePathType;
\r
73 public PathType getTlsTruststorePathType() {
\r
74 return truststorePathType;
\r
78 public String getKeystorePassword() {
\r
79 return "opendaylight";
\r
83 public String getCertificatePassword() {
\r
84 return "opendaylight";
\r
88 public String getTruststorePassword() {
\r
89 return "opendaylight";
\r