001/*
002 * Copyright 2026 Revetware LLC.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package com.revetsec.password;
017
018import javax.annotation.concurrent.Immutable;
019
020/** Fixed internal reasons for a refused password-hashing or verification request. Applications
021 * should present a generic login response, regardless of the reason.
022 * @since 1.0.0 */
023@Immutable
024public enum PasswordRejectionReason {
025    /** The submitted password exceeds a configured input ceiling. */
026    PASSWORD_TOO_LONG,
027    /** The submitted password contains malformed UTF-16. */
028    INVALID_PASSWORD,
029    /** The stored verifier is malformed or exceeds a configured verification ceiling. */
030    INVALID_STORED_HASH,
031    /** The stored verifier is a format not accepted for this operation. */
032    UNSUPPORTED_STORED_HASH,
033    /** A legacy bcrypt candidate would be truncated and cannot prove the complete password. */
034    LEGACY_BCRYPT_INPUT_TOO_LONG
035}