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 2008 Sun Microsystems, Inc.
025 */
026package org.opends.server.admin.std.server;
027
028
029
030import org.opends.server.admin.server.ConfigurationChangeListener;
031import org.opends.server.admin.std.meta.CryptPasswordStorageSchemeCfgDefn.CryptPasswordStorageEncryptionAlgorithm;
032
033
034
035/**
036 * A server-side interface for querying Crypt Password Storage Scheme
037 * settings.
038 * <p>
039 * The Crypt Password Storage Scheme provides a mechanism for encoding
040 * user passwords like Unix crypt does. Like on most Unix systems, the
041 * password may be encrypted using different algorithms, either Unix
042 * crypt, md5, sha256 or sha512.
043 */
044public interface CryptPasswordStorageSchemeCfg extends PasswordStorageSchemeCfg {
045
046  /**
047   * Gets the configuration class associated with this Crypt Password Storage Scheme.
048   *
049   * @return Returns the configuration class associated with this Crypt Password Storage Scheme.
050   */
051  Class<? extends CryptPasswordStorageSchemeCfg> configurationClass();
052
053
054
055  /**
056   * Register to be notified when this Crypt Password Storage Scheme is changed.
057   *
058   * @param listener
059   *          The Crypt Password Storage Scheme configuration change listener.
060   */
061  void addCryptChangeListener(ConfigurationChangeListener<CryptPasswordStorageSchemeCfg> listener);
062
063
064
065  /**
066   * Deregister an existing Crypt Password Storage Scheme configuration change listener.
067   *
068   * @param listener
069   *          The Crypt Password Storage Scheme configuration change listener.
070   */
071  void removeCryptChangeListener(ConfigurationChangeListener<CryptPasswordStorageSchemeCfg> listener);
072
073
074
075  /**
076   * Gets the "crypt-password-storage-encryption-algorithm" property.
077   * <p>
078   * Specifies the algorithm to use to encrypt new passwords.
079   * <p>
080   * Select the crypt algorithm to use to encrypt new passwords. The
081   * value can either be "unix", which means the password is encrypted
082   * with the weak Unix crypt algorithm, or "md5" which means the
083   * password is encrypted with the BSD MD5 algorithm and has a $1$
084   * prefix, or "sha256" which means the password is encrypted with the
085   * SHA256 algorithm and has a $5$ prefix, or "sha512" which means the
086   * password is encrypted with the SHA512 algorithm and has a $6$
087   * prefix.
088   *
089   * @return Returns the value of the "crypt-password-storage-encryption-algorithm" property.
090   */
091  CryptPasswordStorageEncryptionAlgorithm getCryptPasswordStorageEncryptionAlgorithm();
092
093
094
095  /**
096   * Gets the "java-class" property.
097   * <p>
098   * Specifies the fully-qualified name of the Java class that
099   * provides the Crypt Password Storage Scheme implementation.
100   *
101   * @return Returns the value of the "java-class" property.
102   */
103  String getJavaClass();
104
105}