Cryptix OpenPGP

cryptix.openpgp
Class PGPPrincipal

java.lang.Object
  extended bycryptix.openpgp.PGPPrincipal
All Implemented Interfaces:
java.security.Principal

public abstract class PGPPrincipal
extends java.lang.Object
implements java.security.Principal

OpenPGP Principal.

Version:
$Revision: 1.2 $
Author:
Edwin Woudt

Constructor Summary
protected PGPPrincipal(cryptix.openpgp.packet.PGPIDPacket pkt)
          Constructor that takes a packet
 
Method Summary
 boolean equals(java.lang.Object another)
          Compares this principal to another one.
 byte[] getEncoded()
          Return the encoded representation of this principal.
 java.lang.String getName()
          Returns the name of this principal as a String.
 cryptix.openpgp.packet.PGPIDPacket getPacket()
          Return the contained packet Note: packets are part of the low-level API.
 int hashCode()
          Returns a hashcode for this principal Default implementation: returns the hashcode of the contained packet.
 java.lang.String toString()
          Returns a string representation of this principal.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PGPPrincipal

protected PGPPrincipal(cryptix.openpgp.packet.PGPIDPacket pkt)
Constructor that takes a packet

Parameters:
pkt - the packet that contains the data for this principal.
Method Detail

getEncoded

public byte[] getEncoded()
Return the encoded representation of this principal.


getPacket

public cryptix.openpgp.packet.PGPIDPacket getPacket()
Return the contained packet

Note: packets are part of the low-level API. Normally you don't need to use this method as other options are available.


equals

public boolean equals(java.lang.Object another)
Compares this principal to another one.

Default implementation: principals are considered equal if their packets are equal.

Specified by:
equals in interface java.security.Principal

hashCode

public int hashCode()
Returns a hashcode for this principal

Default implementation: returns the hashcode of the contained packet.

Specified by:
hashCode in interface java.security.Principal

getName

public java.lang.String getName()
Returns the name of this principal as a String.

Default implementation: returns the result of the toString() method on the contained packet.

Specified by:
getName in interface java.security.Principal

toString

public java.lang.String toString()
Returns a string representation of this principal.

Default implementation: returns the result of the getName() method.

Specified by:
toString in interface java.security.Principal

Cryptix OpenPGP

Copyright (C) 1999-2003 The Cryptix Foundation Ltd.