cryptix.pgp
Class ArmouredMessage

java.lang.Object
  extended bycryptix.pgp.ArmouredMessage

Deprecated. New code should use ArmouredData in preference to this class.

public final class ArmouredMessage
extends java.lang.Object

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.3 $

Since:
Cryptix 2.2 or earlier
Author:
Ian Brown
See Also:
ArmouredData

Constructor Summary
ArmouredMessage(java.lang.String PGPmsg, KeyGlob keyGlob, Passphrase passphrase)
          Deprecated. Decrypts and verifies an ASCII-armoured encrypted and/or signed message.
ArmouredMessage(java.lang.String msg, SecretKey sender, java.util.Vector recipients)
          Deprecated. Creates a new ASCII-armoured encrypted and signed message.
 
Method Summary
 boolean authenticated()
          Deprecated.  
static byte[] byteEncode(java.lang.String text)
          Deprecated. Use cryptix.mime.LegacyString.toByteArray(text) instead.
 java.lang.String ciphertext()
          Deprecated.  
 boolean encrypted()
          Deprecated.  
 java.lang.String plaintext()
          Deprecated.  
 java.lang.String signedBy()
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArmouredMessage

public ArmouredMessage(java.lang.String msg,
                       SecretKey sender,
                       java.util.Vector recipients)
                throws java.io.IOException
Deprecated. 
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:
java.io.IOException - if there was an I/O error

ArmouredMessage

public ArmouredMessage(java.lang.String PGPmsg,
                       KeyGlob keyGlob,
                       Passphrase passphrase)
                throws DecryptException,
                       FormatException,
                       java.io.IOException,
                       InvalidChecksumException
Deprecated. 
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
FormatException - if the message was incorrectly formatted
java.io.IOException - if there was an I/O error
InvalidChecksumException - if the checksum was invalid
Method Detail

ciphertext

public final java.lang.String ciphertext()
Deprecated. 
Returns:
a String containing this message's ASCII-armoured encrypted text (including the -----BEGIN PGP wrapper).

plaintext

public final java.lang.String plaintext()
Deprecated. 
Returns:
a String containing this message's decrypted text.

signedBy

public final java.lang.String signedBy()
Deprecated. 
Returns:
the name of the person who signed the message (their primary User ID).

authenticated

public final boolean authenticated()
Deprecated. 
Returns:
true if this message is signed correctly.

encrypted

public final boolean encrypted()
Deprecated. 
Returns:
true if the message was/is encrypted

byteEncode

public static byte[] byteEncode(java.lang.String text)
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.