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