Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Cryptix OpenPGP
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## cryptix.message
Class Message

    java.lang.Object
      cryptix.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:

  - "OpenPGP" as defined in RFC 2440
  - "PGP2.x" as defined in RFC 1991
  - "CMS" as defined in RFC 2630
  - "PKCS#7" as defined in RFC 2315
  - "PEM" as defined in RFC 1421

### 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.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Cryptix OpenPGP
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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