Class AuthToken

java.lang.Object
org.dogtagpki.server.authentication.AuthToken
Direct Known Subclasses:
ExternalAuthToken

public class AuthToken extends Object
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 Details

  • Constructor Details

    • AuthToken

      public AuthToken()
    • 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 Details

    • get

      public Object get(String attrName)
      Gets an attribute value.
      Parameters:
      attrName - the name of the attribute to return.
      Returns:
      the attribute value
      Throws:
      EBaseException - on attribute handling errors.
    • getInString

      public String getInString(String attrName)
      Gets an attribute value.
      Parameters:
      attrName - the name of the attribute to return.
      Returns:
      the attribute value
      Throws:
      EBaseException - on attribute handling errors.
    • set

      public boolean set(String attrName, String value)
      Sets an attribute value within this AttrSet.
      Parameters:
      attrName - the name of the attribute
      value - the attribute object.
      Returns:
      false on an error
    • delete

      public void delete(String attrName)
      Removes an attribute in the AuthToken
      Parameters:
      attrName - The name of the attribute to remove.
    • getElements

      public Enumeration<String> getElements()
      Enumerate all attribute names in the AuthToken.
      Returns:
      Enumeration of all attribute names in this AuthToken.
    • getInByteArray

      public byte[] getInByteArray(String name)
      Retrieves the byte array value for name. The value should have been previously stored as a byte array (it will be CMS.AtoB decoded).
      Parameters:
      name - The attribute name.
      Returns:
      The byte array or null on error.
    • set

      public boolean set(String name, byte[] value)
      Stores the byte array with the associated key.
      Parameters:
      name - The attribute name.
      value - The value to store
      Returns:
      false on an error
    • getInInteger

      public Integer getInInteger(String name)
      Retrieves the Integer value for name.
      Parameters:
      name - The attribute name.
      Returns:
      The Integer or null on error.
    • set

      public boolean set(String name, Integer value)
      Stores the Integer with the associated key.
      Parameters:
      name - The attribute name.
      value - The value to store
      Returns:
      false on an error
    • getInBigIntegerArray

      public BigInteger[] getInBigIntegerArray(String name)
      Retrieves the BigInteger array value for name.
      Parameters:
      name - The attribute name.
      Returns:
      The value or null on error.
    • set

      public boolean set(String name, BigInteger[] value)
      Stores the BigInteger array with the associated key.
      Parameters:
      name - The attribute name.
      value - The value to store
      Returns:
      false on an error
    • getInDate

      public Date getInDate(String name)
      Retrieves the Date value for name.
      Parameters:
      name - The attribute name.
      Returns:
      The value or null on error.
    • set

      public boolean set(String name, Date value)
      Stores the Date with the associated key.
      Parameters:
      name - The attribute name.
      value - The value to store
      Returns:
      false on an error
    • getInStringArray

      public String[] getInStringArray(String name)
      Retrieves the String array value for name.
      Parameters:
      name - The attribute name.
      Returns:
      The value or null on error.
    • set

      public boolean set(String name, String[] value)
      Stores the String array with the associated key.
      Parameters:
      name - The attribute name.
      value - The value to store
      Returns:
      False on error.
    • getInCert

      public org.mozilla.jss.netscape.security.x509.X509CertImpl getInCert(String name)
      Retrieves the X509CertImpl value for name.
      Parameters:
      name - The attribute name.
      Returns:
      The value or null on error.
    • set

      public boolean set(String name, org.mozilla.jss.netscape.security.x509.X509CertImpl value)
      Stores the X509CertImpl with the associated key.
      Parameters:
      name - The attribute name.
      value - The value to store
      Returns:
      false on error
    • getInCertExts

      public org.mozilla.jss.netscape.security.x509.CertificateExtensions getInCertExts(String name) throws IOException
      Retrieves the CertificateExtensions value for name.
      Parameters:
      name - The attribute name.
      Returns:
      The value.
      Throws:
      IOException
    • set

      public boolean set(String name, org.mozilla.jss.netscape.security.x509.CertificateExtensions value)
      Stores the CertificateExtensions with the associated key.
      Parameters:
      name - The attribute name.
      value - The value to store
      Returns:
      false on error
    • getInCertificates

      public Certificates getInCertificates(String name) throws IOException, CertificateException
      Retrieves the Certificates value for name.
      Parameters:
      name - The attribute name.
      Returns:
      The value.
      Throws:
      IOException
      CertificateException
    • set

      public boolean set(String name, Certificates value)
      Stores the Certificates with the associated key.
      Parameters:
      name - The attribute name.
      value - The value to store
      Returns:
      false on error
    • getInByteArrayArray

      public byte[][] getInByteArrayArray(String name) throws IOException
      Retrieves the byte[][] value for name.
      Parameters:
      name - The attribute name.
      Returns:
      The value.
      Throws:
      IOException
    • set

      public boolean set(String name, byte[][] value)
      Stores the byte[][] with the associated key.
      Parameters:
      name - The attribute name.
      value - The value to store
      Returns:
      false on error
    • getVals

      public Enumeration<Object> getVals()
      Enumerate all attribute values in the AuthToken.
      Returns:
      Enumeration of all attribute names in this AuthToken.
    • getAuthManagerInstName

      public 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 Date getAuthTime()
      Gets the time of authentication.
      Returns:
      The time of authentication