java.security
Interface Principal

All Known Subinterfaces:
Group
All Known Implementing Classes:
Identity, IdentityScope, KerberosPrincipal, Signer, X500Principal

public interface Principal

This interface models an entity (such as a user or a certificate authority) for the purposes of applying the Java security model.

Since:
1.1
See Also:
X509Certificate

Method Summary
 boolean equals(Object obj)
          This method tests another Principal object for equality with this one.
 String getName()
          This method returns a String that names this Principal.
 int hashCode()
          This method returns a hash code value for this Principal.
 String toString()
          This method returns a String representation of this Principal.
 

Method Detail

equals

boolean equals(Object obj)
This method tests another Principal object for equality with this one.

Overrides:
equals in class Object
Parameters:
obj - the Object to test for equality
Returns:
true if the specified Principal is equal
See Also:
Object.hashCode()

toString

String toString()
This method returns a String representation of this Principal.

Overrides:
toString in class Object
Returns:
this Principal represented as a String
See Also:
Object.getClass(), Object.hashCode(), Class.getName(), Integer.toHexString(int)

hashCode

int hashCode()
This method returns a hash code value for this Principal. Remember the contract of hashCode - two objects which compare as equals() must have the same hashCode().

Overrides:
hashCode in class Object
Returns:
a hash value
See Also:
Object.equals(Object), System.identityHashCode(Object)

getName

String getName()
This method returns a String that names this Principal.

Returns:
the name of this Principal