From 621d9e5c413e561293d7484b93882d985b3fe15f Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Sat, 24 Mar 2012 02:27:47 -0500 Subject: Removed unnecessary pki folder. Previously the source code was located inside a pki folder. This folder was created during svn migration and is no longer needed. This folder has now been removed and the contents have been moved up one level. Ticket #131 --- .../certsrv/authentication/IAuthToken.java | 225 +++++++++++++++++++++ 1 file changed, 225 insertions(+) create mode 100644 base/common/src/com/netscape/certsrv/authentication/IAuthToken.java (limited to 'base/common/src/com/netscape/certsrv/authentication/IAuthToken.java') diff --git a/base/common/src/com/netscape/certsrv/authentication/IAuthToken.java b/base/common/src/com/netscape/certsrv/authentication/IAuthToken.java new file mode 100644 index 000000000..f46ee3ca1 --- /dev/null +++ b/base/common/src/com/netscape/certsrv/authentication/IAuthToken.java @@ -0,0 +1,225 @@ +// --- BEGIN COPYRIGHT BLOCK --- +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; version 2 of the License. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this program; if not, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// +// (C) 2007 Red Hat, Inc. +// All rights reserved. +// --- END COPYRIGHT BLOCK --- +package com.netscape.certsrv.authentication; + +import java.math.BigInteger; +import java.util.Date; +import java.util.Enumeration; + +import netscape.security.x509.CertificateExtensions; +import netscape.security.x509.X509CertImpl; + +import com.netscape.certsrv.base.EBaseException; +import com.netscape.certsrv.usrgrp.Certificates; + +/** + * AuthToken interface. + */ +public interface IAuthToken { + + /** + * Constant for userid. + */ + public static final String USER_ID = "userid"; + + /** + * Sets an attribute value within this AttrSet. + * + * @param name the name of the attribute + * @param value the attribute object. + * @return false on an error + */ + public boolean set(String name, String value); + + /** + * Gets an attribute value. + * + * @param name the name of the attribute to return. + * @exception EBaseException on attribute handling errors. + * @return the attribute value + */ + public String getInString(String name); + + /** + * Returns an enumeration of the names of the attributes existing within + * this AttrSet. + * + * @return an enumeration of the attribute names. + */ + public Enumeration getElements(); + + /************ + * Helpers for non-string sets and gets. + * These are needed because AuthToken is stored in IRequest (which can + * only store string values + */ + + /** + * Retrieves the byte array value for name. The value should have been + * previously stored as a byte array (it will be CMS.AtoB decoded). + * + * @param name The attribute name. + * @return The byte array or null on error. + */ + public byte[] getInByteArray(String name); + + /** + * Stores the byte array with the associated key. + * + * @param name The attribute name. + * @param value The value to store + * @return false on an error + */ + public boolean set(String name, byte[] value); + + /** + * Retrieves the Integer value for name. + * + * @param name The attribute name. + * @return The Integer or null on error. + */ + public Integer getInInteger(String name); + + /** + * Stores the Integer with the associated key. + * + * @param name The attribute name. + * @param value The value to store + * @return false on an error + */ + public boolean set(String name, Integer value); + + /** + * Retrieves the BigInteger array value for name. + * + * @param name The attribute name. + * @return The value or null on error. + */ + public BigInteger[] getInBigIntegerArray(String name); + + /** + * Stores the BigInteger array with the associated key. + * + * @param name The attribute name. + * @param value The value to store + * @return false on an error + */ + public boolean set(String name, BigInteger[] value); + + /** + * Retrieves the Date value for name. + * + * @param name The attribute name. + * @return The value or null on error. + */ + public Date getInDate(String name); + + /** + * Stores the Date with the associated key. + * + * @param name The attribute name. + * @param value The value to store + * @return false on an error + */ + public boolean set(String name, Date value); + + /** + * Retrieves the String array value for name. + * + * @param name The attribute name. + * @return The value or null on error. + */ + public String[] getInStringArray(String name); + + /** + * Stores the String array with the associated key. + * + * @param name The attribute name. + * @param value The value to store + * @return False on error. + */ + public boolean set(String name, String[] value); + + /** + * Retrieves the X509CertImpl value for name. + * + * @param name The attribute name. + * @return The value or null on error. + */ + public X509CertImpl getInCert(String name); + + /** + * Stores the X509CertImpl with the associated key. + * + * @param name The attribute name. + * @param value The value to store + * @return false on error + */ + public boolean set(String name, X509CertImpl value); + + /** + * Retrieves the CertificateExtensions value for name. + * + * @param name The attribute name. + * @return The value or null on error. + */ + public CertificateExtensions getInCertExts(String name); + + /** + * Stores the CertificateExtensions with the associated key. + * + * @param name The attribute name. + * @param value The value to store + * @return false on error + */ + public boolean set(String name, CertificateExtensions value); + + /** + * Retrieves the Certificates value for name. + * + * @param name The attribute name. + * @return The value or null on error. + */ + public Certificates getInCertificates(String name); + + /** + * Stores the Certificates with the associated key. + * + * @param name The attribute name. + * @param value The value to store + * @return false on error + */ + public boolean set(String name, Certificates value); + + /** + * Retrieves the byte[][] value for name. + * + * @param name The attribute name. + * @return The value or null on error. + */ + public byte[][] getInByteArrayArray(String name); + + /** + * Stores the byte[][] with the associated key. + * + * @param name The attribute name. + * @param value The value to store + * @return false on error + */ + public boolean set(String name, byte[][] value); +} -- cgit