⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 authresult.java

📁 一套JAVA的CA证书签发系统.
💻 JAVA
字号:
/************************************************************************* *                                                                       * *  EJBCA: The OpenSource Certificate Authority                          * *                                                                       * *  This software is free software; you can redistribute it and/or       * *  modify it under the terms of the GNU Lesser General Public           * *  License as published by the Free Software Foundation; either         * *  version 2.1 of the License, or any later version.                    * *                                                                       * *  See terms of license at gnu.org.                                     * *                                                                       * *************************************************************************/ package se.anatom.ejbca.samples;import java.util.Hashtable;/** * Class containing the complete result from an authenticateUser request. * * @author Original code by Peter Neemeth * @version $Id: AuthResult.java,v 1.4 2004/04/16 07:39:02 anatom Exp $ */public class AuthResult {    /** Constants for grant and reject */    private static final boolean GRANT_STATUS = true;    private static final boolean REJECT_STATUS = false;    /** Default to rejecting a request */    private boolean status = REJECT_STATUS; //GRANT_STATUS or REJECT_STATUS    /** What was the reason to reject this request? */    private String reason = ""; //No reason    /** This Hashtable keeps all the name-value pairs in the result. */    private Hashtable resultHash = new Hashtable();    /**     * Adds a new key, value pair to the grant response.     *     * @param key left hand value. Must be unique for this result     * @param value right hand value     */    public void add(final String key, final String value) {        resultHash.put(key, value);    }    /**     * DOCUMENT ME!     *     * @return reason for rejecting this request     */    public String getReason() {        return reason;    }    /**     * Get result as Hashtable.     *     * @return hash table of results     */    public Hashtable getResult() {        return resultHash;    }    /**     * Set status to GRANT     */    public void grant() {        status = GRANT_STATUS;    }    /**     * DOCUMENT ME!     *     * @return true if the request was GRANTed     */    public boolean granted() {        return status == GRANT_STATUS;    }    /**     * Set status to REJECT     */    public void reject() {        status = REJECT_STATUS;    }    /**     * DOCUMENT ME!     *     * @return true if the request was REJECTed     */    public boolean rejected() {        return status == REJECT_STATUS;    }    /**     * Set reason of rejected request. No default.     *     * @param newReason describing why the request was rejected     */    public void setReason(final String newReason) {        reason = newReason;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -