All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cryptix.pgp.ArmouredMessage

java.lang.Object
   |
   +----cryptix.pgp.ArmouredMessage

public final class ArmouredMessage
extends Object
Note: ArmouredMessage is deprecated. New code should use ArmouredData in preference to this class.

Represents an ASCII-armoured PGP encrypted message.

Can encrypt a String, given public keys to encrypt to, and sign with the relevant secret key - but won't compress the data. That's for the next version.

Can also decrypt an armoured message.

FUTURE CHANGES

Copyright © 1997 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.2 $

Author:
Ian Brown
See Also:
ArmouredData

Constructor Index

 o ArmouredMessage(String, KeyGlob, Passphrase)
Decrypts and verifies an ASCII-armoured encrypted and/or signed message.
 o ArmouredMessage(String, SecretKey, Vector)
Creates a new ASCII-armoured encrypted and signed message.

Method Index

 o authenticated()
 o byteEncode(String)
These PGP classes work on byte arrays, not strings. Deprecated.
 o ciphertext()
 o encrypted()
 o plaintext()
 o signedBy()

Constructors

 o ArmouredMessage
 public ArmouredMessage(String msg,
                        SecretKey sender,
                        Vector recipients) throws IOException
Creates a new ASCII-armoured encrypted and signed message.

If sender is null, the message will only be encrypted.

If recipients is empty, the message will be clearsigned.

The values returned by plaintext() and ciphertext() will be set appropriately.

Parameters:
msg - a string that you want to encrypt
sender - the sender's PGP secret key
recipients - a Vector containing the public keys of the message's recipient(s)
Throws: IOException
if there was an I/O error
 o ArmouredMessage
 public ArmouredMessage(String PGPmsg,
                        KeyGlob keyGlob,
                        Passphrase passphrase) throws DecryptException, FormatException, IOException, InvalidChecksumException
Decrypts and verifies an ASCII-armoured encrypted and/or signed message. plaintext() will return the decrypted message.

Parameters:
PGPmsg - a string that you want to decrypt. It must include the "-----BEGIN PGP" and "-----END PGP" wrapper.
keyGlob - a KeyGlob containing keyrings and reference to a keyserver where all the keys needed to decrypt or check this message can be found.
passphrase - the user's passphrase
Throws: DecryptException
if the message could not be decrypted
Throws: FormatException
if the message was incorrectly formatted
Throws: IOException
if there was an I/O error
Throws: InvalidChecksumException
if the checksum was invalid

Methods

 o ciphertext
 public final String ciphertext()
Returns:
a String containing this message's ASCII-armoured encrypted text (including the -----BEGIN PGP wrapper).
 o plaintext
 public final String plaintext()
Returns:
a String containing this message's decrypted text.
 o signedBy
 public final String signedBy()
Returns:
the name of the person who signed the message (their primary User ID).
 o authenticated
 public final boolean authenticated()
Returns:
true if this message is signed correctly.
 o encrypted
 public final boolean encrypted()
Returns:
true if the message was/is encrypted
 o byteEncode
 public static byte[] byteEncode(String text)
Note: byteEncode() is deprecated. Use cryptix.mime.LegacyString.toByteArray(text) instead.

These PGP classes work on byte arrays, not strings. This function converts from one to the other.

Returns:
A byte array representing text in ISO-Latin-1.

All Packages  Class Hierarchy  This Package  Previous  Next  Index