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.KeyManager; 020 021import org.opends.server.admin.std.server.KeyManagerProviderCfg; 022import org.opends.server.api.KeyManagerProvider; 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 key manager provider that does not 029 * actually have the ability to provide a key manager. It will be used when no 030 * other key manager provider has been defined in the server configuration. 031 */ 032public class NullKeyManagerProvider 033 extends KeyManagerProvider<KeyManagerProviderCfg>{ 034 035 036 037 /** 038 * Creates a new instance of this null key manager provider. The 039 * <CODE>initializeKeyManagerProvider</CODE> method must be called on the 040 * resulting object before it may be used. 041 */ 042 public NullKeyManagerProvider() 043 { 044 // No implementation is required. 045 } 046 047 048 049 /** {@inheritDoc} */ 050 @Override 051 public void initializeKeyManagerProvider( 052 KeyManagerProviderCfg configuration) throws ConfigException, 053 InitializationException { 054 // No implementation is required. 055 } 056 057 058 059 /** 060 * Performs any finalization that may be necessary for this key manager 061 * provider. 062 */ 063 public void finalizeKeyManagerProvider() 064 { 065 // No implementation is required. 066 } 067 068 069 070 /** 071 * Retrieves a <CODE>KeyManager</CODE> object that may be used for 072 * interactions requiring access to a key manager. 073 * 074 * @return A <CODE>KeyManager</CODE> object that may be used for interactions 075 * requiring access to a key manager. 076 * 077 * @throws DirectoryException If a problem occurs while attempting to obtain 078 * the set of key managers. 079 */ 080 public KeyManager[] getKeyManagers() 081 throws DirectoryException 082 { 083 return new KeyManager[0]; 084 } 085} 086