Merge "add basic lib - plugin communication"
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / openflow / lib / SslKeyStore.java
1 /* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
2 package org.openflow.lib;
3
4 import java.io.InputStream;
5
6 /**
7  * Class for storing keys
8  *
9  * @author michal.polkorab
10  */
11 public final class SslKeyStore {
12
13     private static final String filename = "/key.bin";
14
15     /**
16      * InputStream instance of key
17      *
18      * @return key as InputStream
19      */
20     public static InputStream asInputStream() {
21         InputStream in = SslKeyStore.class.getResourceAsStream(filename);
22         if (in == null) {
23             throw new IllegalStateException("KeyStore file not found: " + filename);
24         }
25         return in;
26     }
27
28     /**
29      * @return certificate password as char[]
30      */
31     public static char[] getCertificatePassword() {
32         return "secret".toCharArray();
33     }
34
35     /**
36      * @return KeyStore password as char[]
37      */
38     public static char[] getKeyStorePassword() {
39         return "secret".toCharArray();
40     }
41 }