1 /** 2 * $RCSfile$ 3 * $Revision$ 4 * $Date$ 5 * 6 * 7 * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 */ 19 20 package org.jivesoftware.smack.sasl; 21 22 import org.jivesoftware.smack.SASLAuthentication; 23 24 /** 25 * Implementation of the SASL EXTERNAL mechanism. 26 * 27 * To effectively use this mechanism, Java must be configured to properly 28 * supply a client SSL certificate (of some sort) to the server. It is up 29 * to the implementer to determine how to do this. Here is one method: 30 * 31 * Create a java keystore with your SSL certificate in it: 32 * keytool -genkey -alias username -dname "cn=username,ou=organizationalUnit,o=organizationaName,l=locality,s=state,c=country" 33 * 34 * Next, set the System Properties: 35 * <ul> 36 * <li>javax.net.ssl.keyStore to the location of the keyStore 37 * <li>javax.net.ssl.keyStorePassword to the password of the keyStore 38 * <li>javax.net.ssl.trustStore to the location of the trustStore 39 * <li>javax.net.ssl.trustStorePassword to the the password of the trustStore 40 * </ul> 41 * 42 * Then, when the server requests or requires the client certificate, java will 43 * simply provide the one in the keyStore. 44 * 45 * Also worth noting is the EXTERNAL mechanism in Smack is not enabled by default. 46 * To enable it, the implementer will need to call SASLAuthentication.supportSASLMechamism("EXTERNAL"); 47 * 48 * @author Jay Kline 49 */ 50 public class SASLExternalMechanism extends SASLMechanism { 51 52 public SASLExternalMechanism(SASLAuthentication saslAuthentication) { 53 super(saslAuthentication); 54 } 55 56 protected String getName() { 57 return "EXTERNAL"; 58 } 59 } 60