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