home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / java / security / Principal.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  1.6 KB  |  62 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)Principal.java    1.16 98/06/29
  3.  *
  4.  * Copyright 1996-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.security;
  16.  
  17. /**
  18.  * This interface represents the abstract notion of a principal, which
  19.  * can be used to represent any entity, such as an individual, a
  20.  * corporation, and a login id.
  21.  *
  22.  * @see java.security.cert.X509Certificate
  23.  *
  24.  * @version 1.16, 99/03/26
  25.  * @author Li Gong */
  26. public interface Principal {
  27.  
  28.     /**
  29.      * Compares this principal to the specified object.  Returns true
  30.      * if the object passed in matches the principal represented by
  31.      * the implementation of this interface.
  32.      *
  33.      * @param another principal to compare with.
  34.      *
  35.      * @return true if the principal passed in is the same as that
  36.      * encapsulated by this principal, and false otherwise.
  37.  
  38.      */
  39.     public boolean equals(Object another);
  40.  
  41.     /**
  42.      * Returns a string representation of this principal.
  43.      *
  44.      * @return a string representation of this principal.
  45.      */
  46.     public String toString();
  47.  
  48.     /**
  49.      * Returns a hashcode for this principal.
  50.      *
  51.      * @return a hashcode for this principal.
  52.      */
  53.     public int hashCode();
  54.  
  55.     /**
  56.      * Returns the name of this principal.
  57.      *
  58.      * @return the name of this principal.
  59.      */
  60.     public String getName();
  61. }
  62.