01: /*
02: * $Id: TlsDirectKeyStore.java 10489 2008-01-23 17:53:38Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10:
11: package org.mule.api.security;
12:
13: import java.io.IOException;
14:
15: import javax.net.ssl.KeyManagerFactory;
16:
17: /**
18: * Configure direct key stores.
19: * TLS/SSL connections are made on behalf of an entity, which can be anonymous or identified by a
20: * certificate - this interface specifies how a keystore can be used to provide the certificates
21: * (and associated private keys) necessary for identification.
22: *
23: * <p>The information specified in this interface is used to configure a key store directly.
24: * For more information see the documentation for the connector or protocol in question.
25: * The comments in {@link org.mule.api.security.tls.TlsConfiguration} may also be useful.</p>
26: */
27: public interface TlsDirectKeyStore {
28:
29: /**
30: * @return The location (resolved relative to the current classpath and file system, if possible)
31: * of the keystore that contains public certificates and private keys for identification.
32: */
33: String getKeyStore();
34:
35: /**
36: * @param name The location of the keystore that contains public certificates and private keys
37: * for identification.
38: * @throws IOException If the location cannot be resolved via the file system or classpath
39: */
40: void setKeyStore(String name) throws IOException;
41:
42: /**
43: * @return The password used to protect the private key(s)
44: */
45: String getKeyPassword();
46:
47: /**
48: * @param keyPassword The password used to protect the private key(s)
49: */
50: void setKeyPassword(String keyPassword);
51:
52: /**
53: * @return The password used to protect the keystore itself
54: */
55: String getKeyStorePassword();
56:
57: /**
58: * @param storePassword The password used to protect the keystore itself
59: */
60: void setKeyStorePassword(String storePassword);
61:
62: /**
63: * @return The type of keystore used in {@link #getKeyStore()}
64: */
65: String getKeyStoreType();
66:
67: /**
68: * @param keystoreType The type of keystore used in {@link #setKeyStore(String)}
69: */
70: void setKeyStoreType(String keystoreType);
71:
72: /**
73: * @return The algorithm used by the key store. The default comes from {
74: * @link org.mule.api.security.provider.AutoDiscoverySecurityProviderFactory}
75: */
76: String getKeyManagerAlgorithm();
77:
78: /**
79: * @param keyManagerAlgorithm The algorithm used by the key store. The default comes from {
80: * @link org.mule.api.security.provider.AutoDiscoverySecurityProviderFactory}
81: */
82: void setKeyManagerAlgorithm(String keyManagerAlgorithm);
83:
84: /**
85: * @return A source of key stores generated from the parameters supplied here.
86: */
87: KeyManagerFactory getKeyManagerFactory();
88:
89: }
|