001/* 002 * The contents of this file are subject to the terms of the Common Development and 003 * Distribution License (the License). You may not use this file except in compliance with the 004 * License. 005 * 006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the 007 * specific language governing permission and limitations under the License. 008 * 009 * When distributing Covered Software, include this CDDL Header Notice in each file and include 010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL 011 * Header, with the fields enclosed by brackets [] replaced by your own identifying 012 * information: "Portions Copyright [year] [name of copyright owner]". 013 * 014 * Copyright 2006-2008 Sun Microsystems, Inc. 015 * Portions Copyright 2014-2015 ForgeRock AS. 016 */ 017package org.opends.server.extensions; 018 019import javax.net.ssl.TrustManager; 020 021import org.opends.server.admin.std.server.TrustManagerProviderCfg; 022import org.opends.server.api.TrustManagerProvider; 023import org.forgerock.opendj.config.server.ConfigException; 024import org.opends.server.types.DirectoryException; 025import org.opends.server.types.InitializationException; 026 027/** 028 * This class provides an implementation of a trust manager provider that does 029 * not actually have the ability to provide a trust manager. It will be used 030 * when no other trust manager provider has been defined in the server 031 * configuration. 032 */ 033public class NullTrustManagerProvider 034 extends TrustManagerProvider<TrustManagerProviderCfg> 035{ 036 /** 037 * Creates a new instance of this null trust manager provider. The 038 * <CODE>initializeTrustManagerProvider</CODE> method must be called on the 039 * resulting object before it may be used. 040 */ 041 public NullTrustManagerProvider() 042 { 043 // No implementation is required. 044 } 045 046 047 048 /** {@inheritDoc} */ 049 public void initializeTrustManagerProvider( 050 TrustManagerProviderCfg configuration) 051 throws ConfigException, InitializationException 052 { 053 // No implementation is required. 054 } 055 056 057 058 /** 059 * Performs any finalization that may be necessary for this trust manager 060 * provider. 061 */ 062 public void finalizeTrustManagerProvider() 063 { 064 // No implementation is required. 065 } 066 067 068 069 /** 070 * Retrieves a <CODE>TrustManager</CODE> object that may be used for 071 * interactions requiring access to a trust manager. 072 * 073 * @return A <CODE>TrustManager</CODE> object that may be used for 074 * interactions requiring access to a trust manager. 075 * 076 * @throws DirectoryException If a problem occurs while attempting to obtain 077 * the set of trust managers. 078 */ 079 public TrustManager[] getTrustManagers() 080 throws DirectoryException 081 { 082 return new TrustManager[0]; 083 } 084} 085