Cryptix OpenPGP

cryptix.message
Class Message

java.lang.Object
  extended bycryptix.message.Message
Direct Known Subclasses:
EncryptedMessage, KeyBundleMessage, LiteralMessage, PGPArmouredMessage, PGPDetachedSignatureMessage, SignedMessage

public abstract class Message
extends java.lang.Object

Top-level class for all messages.

Version:
$Revision: 1.3 $
Author:
Edwin Woudt , Jeroen C. van Gelderen

Constructor Summary
protected Message(java.lang.String format)
          Creates a Message of the specified format.
 
Method Summary
 boolean equals(java.lang.Object other)
          Do equality comparison based on equality of the byte[]s returned by getEncoded().
abstract  java.lang.Object getAttribute(java.lang.String name)
          Get a format specific attribute.
abstract  byte[] getEncoded()
          Returns the message in encoded format.
 java.lang.String getFormat()
          Returns the encoding format of this message.
 int hashCode()
          Returns a hashCode for this object based on the encoded form.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Message

protected Message(java.lang.String format)
Creates a Message of the specified format.

Method Detail

equals

public boolean equals(java.lang.Object other)
Do equality comparison based on equality of the byte[]s returned by getEncoded().


hashCode

public int hashCode()
Returns a hashCode for this object based on the encoded form.


getFormat

public java.lang.String getFormat()
Returns the encoding format of this message.

Potential examples are:


getEncoded

public abstract byte[] getEncoded()
                           throws MessageException
Returns the message in encoded format.

Throws:
MessageException - on a variety of format specific problems.

getAttribute

public abstract java.lang.Object getAttribute(java.lang.String name)
                                       throws java.lang.IllegalArgumentException,
                                              MessageException
Get a format specific attribute.

Parameters:
name - a name identifying the attribute
Returns:
the attribute or null if the attribute isn't set.
Throws:
java.lang.IllegalArgumentException - if the attribute is not supported on this format. (Note: if an attribute is supported but not set, then this method should return null instead of throwing this exception.)
MessageException - on a variety of format specific problems.

Cryptix OpenPGP

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