Class AuthToken
- java.lang.Object
-
- org.dogtagpki.server.authentication.AuthToken
-
- All Implemented Interfaces:
com.netscape.certsrv.authentication.IAuthToken
public class AuthToken extends java.lang.Object implements com.netscape.certsrv.authentication.IAuthToken
Authentication token returned by Authentication Managers. Upon return, it contains authentication/identification information as well as information retrieved from the database where the authentication was done against. Each authentication manager has its own list of such information. See individual authenticaiton manager for more details.- Version:
- $Revision$, $Date$
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Hashtable<java.lang.String,java.lang.Object>
mAttrs
-
Fields inherited from interface com.netscape.certsrv.authentication.IAuthToken
GROUP, GROUPS, TOKEN_AUTHENTICATED_CERT_SUBJECT, TOKEN_AUTHMGR_INST_NAME, TOKEN_AUTHTIME, TOKEN_CERT, TOKEN_CERT_EXTENSIONS, TOKEN_CERT_NOTAFTER, TOKEN_CERT_NOTBEFORE, TOKEN_CERT_SERIALNUM, TOKEN_CERT_SUBJECT, TOKEN_CERT_TO_REVOKE, TOKEN_SHARED_TOKEN_AUTHENTICATED_CERT_SUBJECT, UID, USER, USER_DN, USER_ID
-
-
Constructor Summary
Constructors Constructor Description AuthToken(AuthManager authMgr)
Constructs an instance of a authentication token.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete(java.lang.String attrName)
Removes an attribute in the AuthTokenjava.lang.Object
get(java.lang.String attrName)
Gets an attribute value.java.lang.String
getAuthManagerInstName()
Gets the name of the authentication manager instance that created this token.java.util.Date
getAuthTime()
Gets the time of authentication.java.util.Enumeration<java.lang.String>
getElements()
Enumerate all attribute names in the AuthToken.java.math.BigInteger[]
getInBigIntegerArray(java.lang.String name)
Retrieves the BigInteger array value for name.byte[]
getInByteArray(java.lang.String name)
Retrieves the byte array value for name.byte[][]
getInByteArrayArray(java.lang.String name)
Retrieves the byte[][] value for name.org.mozilla.jss.netscape.security.x509.X509CertImpl
getInCert(java.lang.String name)
Retrieves the X509CertImpl value for name.org.mozilla.jss.netscape.security.x509.CertificateExtensions
getInCertExts(java.lang.String name)
Retrieves the CertificateExtensions value for name.Certificates
getInCertificates(java.lang.String name)
Retrieves the Certificates value for name.java.util.Date
getInDate(java.lang.String name)
Retrieves the Date value for name.java.lang.Integer
getInInteger(java.lang.String name)
Retrieves the Integer value for name.java.lang.String
getInString(java.lang.String attrName)
Gets an attribute value.java.lang.String[]
getInStringArray(java.lang.String name)
Retrieves the String array value for name.java.util.Enumeration<java.lang.Object>
getVals()
Enumerate all attribute values in the AuthToken.boolean
set(java.lang.String name, byte[] value)
Stores the byte array with the associated key.boolean
set(java.lang.String name, byte[][] value)
Stores the byte[][] with the associated key.boolean
set(java.lang.String name, Certificates value)
Stores the Certificates with the associated key.boolean
set(java.lang.String name, java.lang.Integer value)
Stores the Integer with the associated key.boolean
set(java.lang.String attrName, java.lang.String value)
Sets an attribute value within this AttrSet.boolean
set(java.lang.String name, java.lang.String[] value)
Stores the String array with the associated key.boolean
set(java.lang.String name, java.math.BigInteger[] value)
Stores the BigInteger array with the associated key.boolean
set(java.lang.String name, java.util.Date value)
Stores the Date with the associated key.boolean
set(java.lang.String name, org.mozilla.jss.netscape.security.x509.CertificateExtensions value)
Stores the CertificateExtensions with the associated key.boolean
set(java.lang.String name, org.mozilla.jss.netscape.security.x509.X509CertImpl value)
Stores the X509CertImpl with the associated key.
-
-
-
Constructor Detail
-
AuthToken
public AuthToken(AuthManager authMgr)
Constructs an instance of a authentication token. The token by default contains the following attributes:
"authMgrInstName" - The authentication manager instance name. "authTime" - The - The time of authentication.
- Parameters:
authMgr
- The authentication manager that created this Token.
-
-
Method Detail
-
get
public java.lang.Object get(java.lang.String attrName)
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Gets an attribute value.- Specified by:
get
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
attrName
- the name of the attribute to return.- Returns:
- the attribute value
-
getInString
public java.lang.String getInString(java.lang.String attrName)
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Gets an attribute value.- Specified by:
getInString
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
attrName
- the name of the attribute to return.- Returns:
- the attribute value
-
set
public boolean set(java.lang.String attrName, java.lang.String value)
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Sets an attribute value within this AttrSet.- Specified by:
set
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
attrName
- the name of the attributevalue
- the attribute object.- Returns:
- false on an error
-
delete
public void delete(java.lang.String attrName)
Removes an attribute in the AuthToken- Parameters:
attrName
- The name of the attribute to remove.
-
getElements
public java.util.Enumeration<java.lang.String> getElements()
Enumerate all attribute names in the AuthToken.- Specified by:
getElements
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Returns:
- Enumeration of all attribute names in this AuthToken.
-
getInByteArray
public byte[] getInByteArray(java.lang.String name)
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Retrieves the byte array value for name. The value should have been previously stored as a byte array (it will be CMS.AtoB decoded).- Specified by:
getInByteArray
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
name
- The attribute name.- Returns:
- The byte array or null on error.
-
set
public boolean set(java.lang.String name, byte[] value)
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Stores the byte array with the associated key.- Specified by:
set
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
name
- The attribute name.value
- The value to store- Returns:
- false on an error
-
getInInteger
public java.lang.Integer getInInteger(java.lang.String name)
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Retrieves the Integer value for name.- Specified by:
getInInteger
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
name
- The attribute name.- Returns:
- The Integer or null on error.
-
set
public boolean set(java.lang.String name, java.lang.Integer value)
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Stores the Integer with the associated key.- Specified by:
set
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
name
- The attribute name.value
- The value to store- Returns:
- false on an error
-
getInBigIntegerArray
public java.math.BigInteger[] getInBigIntegerArray(java.lang.String name)
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Retrieves the BigInteger array value for name.- Specified by:
getInBigIntegerArray
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
name
- The attribute name.- Returns:
- The value or null on error.
-
set
public boolean set(java.lang.String name, java.math.BigInteger[] value)
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Stores the BigInteger array with the associated key.- Specified by:
set
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
name
- The attribute name.value
- The value to store- Returns:
- false on an error
-
getInDate
public java.util.Date getInDate(java.lang.String name)
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Retrieves the Date value for name.- Specified by:
getInDate
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
name
- The attribute name.- Returns:
- The value or null on error.
-
set
public boolean set(java.lang.String name, java.util.Date value)
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Stores the Date with the associated key.- Specified by:
set
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
name
- The attribute name.value
- The value to store- Returns:
- false on an error
-
getInStringArray
public java.lang.String[] getInStringArray(java.lang.String name)
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Retrieves the String array value for name.- Specified by:
getInStringArray
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
name
- The attribute name.- Returns:
- The value or null on error.
-
set
public boolean set(java.lang.String name, java.lang.String[] value)
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Stores the String array with the associated key.- Specified by:
set
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
name
- The attribute name.value
- The value to store- Returns:
- False on error.
-
getInCert
public org.mozilla.jss.netscape.security.x509.X509CertImpl getInCert(java.lang.String name)
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Retrieves the X509CertImpl value for name.- Specified by:
getInCert
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
name
- The attribute name.- Returns:
- The value or null on error.
-
set
public boolean set(java.lang.String name, org.mozilla.jss.netscape.security.x509.X509CertImpl value)
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Stores the X509CertImpl with the associated key.- Specified by:
set
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
name
- The attribute name.value
- The value to store- Returns:
- false on error
-
getInCertExts
public org.mozilla.jss.netscape.security.x509.CertificateExtensions getInCertExts(java.lang.String name) throws java.io.IOException
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Retrieves the CertificateExtensions value for name.- Specified by:
getInCertExts
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
name
- The attribute name.- Returns:
- The value.
- Throws:
java.io.IOException
-
set
public boolean set(java.lang.String name, org.mozilla.jss.netscape.security.x509.CertificateExtensions value)
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Stores the CertificateExtensions with the associated key.- Specified by:
set
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
name
- The attribute name.value
- The value to store- Returns:
- false on error
-
getInCertificates
public Certificates getInCertificates(java.lang.String name) throws java.io.IOException, java.security.cert.CertificateException
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Retrieves the Certificates value for name.- Specified by:
getInCertificates
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
name
- The attribute name.- Returns:
- The value.
- Throws:
java.io.IOException
java.security.cert.CertificateException
-
set
public boolean set(java.lang.String name, Certificates value)
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Stores the Certificates with the associated key.- Specified by:
set
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
name
- The attribute name.value
- The value to store- Returns:
- false on error
-
getInByteArrayArray
public byte[][] getInByteArrayArray(java.lang.String name) throws java.io.IOException
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Retrieves the byte[][] value for name.- Specified by:
getInByteArrayArray
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
name
- The attribute name.- Returns:
- The value.
- Throws:
java.io.IOException
-
set
public boolean set(java.lang.String name, byte[][] value)
Description copied from interface:com.netscape.certsrv.authentication.IAuthToken
Stores the byte[][] with the associated key.- Specified by:
set
in interfacecom.netscape.certsrv.authentication.IAuthToken
- Parameters:
name
- The attribute name.value
- The value to store- Returns:
- false on error
-
getVals
public java.util.Enumeration<java.lang.Object> getVals()
Enumerate all attribute values in the AuthToken.- Returns:
- Enumeration of all attribute names in this AuthToken.
-
getAuthManagerInstName
public java.lang.String getAuthManagerInstName()
Gets the name of the authentication manager instance that created this token.- Returns:
- The name of the authentication manager instance that created this token.
-
getAuthTime
public java.util.Date getAuthTime()
Gets the time of authentication.- Returns:
- The time of authentication
-
-