1 /* 2 * $Id: TlsDirectKeyStore.java 10489 2008-01-23 17:53:38Z dfeist $ 3 * -------------------------------------------------------------------------------------- 4 * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com 5 * 6 * The software in this package is published under the terms of the CPAL v1.0 7 * license, a copy of which has been included with this distribution in the 8 * LICENSE.txt file. 9 */ 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 /** 31 * @return The location (resolved relative to the current classpath and file system, if possible) 32 * of the keystore that contains public certificates and private keys for identification. 33 */ 34 String getKeyStore(); 35 36 /** 37 * @param name The location of the keystore that contains public certificates and private keys 38 * for identification. 39 * @throws IOException If the location cannot be resolved via the file system or classpath 40 */ 41 void setKeyStore(String name) throws IOException; 42 43 /** 44 * @return The password used to protect the private key(s) 45 */ 46 String getKeyPassword(); 47 48 /** 49 * @param keyPassword The password used to protect the private key(s) 50 */ 51 void setKeyPassword(String keyPassword); 52 53 /** 54 * @return The password used to protect the keystore itself 55 */ 56 String getKeyStorePassword(); 57 58 /** 59 * @param storePassword The password used to protect the keystore itself 60 */ 61 void setKeyStorePassword(String storePassword); 62 63 /** 64 * @return The type of keystore used in {@link #getKeyStore()} 65 */ 66 String getKeyStoreType(); 67 68 /** 69 * @param keystoreType The type of keystore used in {@link #setKeyStore(String)} 70 */ 71 void setKeyStoreType(String keystoreType); 72 73 /** 74 * @return The algorithm used by the key store. The default comes from { 75 * @link org.mule.api.security.provider.AutoDiscoverySecurityProviderFactory} 76 */ 77 String getKeyManagerAlgorithm(); 78 79 /** 80 * @param keyManagerAlgorithm The algorithm used by the key store. The default comes from { 81 * @link org.mule.api.security.provider.AutoDiscoverySecurityProviderFactory} 82 */ 83 void setKeyManagerAlgorithm(String keyManagerAlgorithm); 84 85 /** 86 * @return A source of key stores generated from the parameters supplied here. 87 */ 88 KeyManagerFactory getKeyManagerFactory(); 89 90 } 91 92