001/*
002 * Copyright 2021-2024 Ping Identity Corporation
003 * All Rights Reserved.
004 */
005/*
006 * Copyright 2021-2024 Ping Identity Corporation
007 *
008 * Licensed under the Apache License, Version 2.0 (the "License");
009 * you may not use this file except in compliance with the License.
010 * You may obtain a copy of the License at
011 *
012 *    http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing, software
015 * distributed under the License is distributed on an "AS IS" BASIS,
016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017 * See the License for the specific language governing permissions and
018 * limitations under the License.
019 */
020/*
021 * Copyright (C) 2021-2024 Ping Identity Corporation
022 *
023 * This program is free software; you can redistribute it and/or modify
024 * it under the terms of the GNU General Public License (GPLv2 only)
025 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
026 * as published by the Free Software Foundation.
027 *
028 * This program is distributed in the hope that it will be useful,
029 * but WITHOUT ANY WARRANTY; without even the implied warranty of
030 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
031 * GNU General Public License for more details.
032 *
033 * You should have received a copy of the GNU General Public License
034 * along with this program; if not, see <http://www.gnu.org/licenses>.
035 */
036package com.unboundid.ldap.sdk.unboundidds.extensions;
037
038
039
040import com.unboundid.asn1.ASN1Element;
041import com.unboundid.asn1.ASN1Null;
042import com.unboundid.util.NotNull;
043import com.unboundid.util.ThreadSafety;
044import com.unboundid.util.ThreadSafetyLevel;
045
046
047
048/**
049 * This class provides a {@link ReplaceCertificateTrustBehavior} implementation
050 * to indicate that the listener certificate should be trusted by the JVM's
051 * default trust manager.
052 * <BR>
053 * <BLOCKQUOTE>
054 *   <B>NOTE:</B>  This class, and other classes within the
055 *   {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only
056 *   supported for use against Ping Identity, UnboundID, and
057 *   Nokia/Alcatel-Lucent 8661 server products.  These classes provide support
058 *   for proprietary functionality or for external specifications that are not
059 *   considered stable or mature enough to be guaranteed to work in an
060 *   interoperable way with other types of LDAP servers.
061 * </BLOCKQUOTE>
062 */
063@ThreadSafety(level=ThreadSafetyLevel.INTERFACE_THREADSAFE)
064public final class JVMDefaultReplaceCertificateTrustBehavior
065       extends ReplaceCertificateTrustBehavior
066{
067  /**
068   * The BER type to use for the ASN.1 element containing an encoded
069   * representation of this trust behavior object.
070   */
071  static final byte TYPE_TRUST_BEHAVIOR = (byte) 0x85;
072
073
074
075  /**
076   * The singleton instance of this object.
077   */
078  @NotNull private static final JVMDefaultReplaceCertificateTrustBehavior
079       INSTANCE = new JVMDefaultReplaceCertificateTrustBehavior();
080
081
082
083  /**
084   * The serial version UID for this serializable class.
085   */
086  private static final long serialVersionUID = -152041578618539580L;
087
088
089
090  /**
091   * Creates a new JVM-default replace certificate trust behavior object.
092   */
093  private JVMDefaultReplaceCertificateTrustBehavior()
094  {
095    // Prevent this class from being externally instantiated.
096  }
097
098
099
100  /**
101   * Retrieves the singleton instance of this JVM-default trust behavior object.
102   *
103   * @return  The singleton instance of this JVM-default trust behavior object.
104   */
105  @NotNull()
106  public static JVMDefaultReplaceCertificateTrustBehavior getInstance()
107  {
108    return INSTANCE;
109  }
110
111
112
113  /**
114   * {@inheritDoc}
115   */
116  @Override()
117  @NotNull()
118  public ASN1Element encode()
119  {
120    return new ASN1Null(TYPE_TRUST_BEHAVIOR);
121  }
122
123
124
125  /**
126   * {@inheritDoc}
127   */
128  @Override()
129  public void toString(@NotNull final StringBuilder buffer)
130  {
131    buffer.append("JVMDefaultReplaceCertificateTrustBehavior()");
132  }
133}