Cryptix OpenPGP

cryptix.message.stream
Class SignedMessageOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended bycryptix.message.stream.MessageOutputStream
          extended bycryptix.message.stream.SignedMessageOutputStream

public final class SignedMessageOutputStream
extends MessageOutputStream

A stream that adds signs and appends the signature to another stream.

Version:
$Revision: 1.1 $
Author:
Edwin Woudt

Field Summary
 
Fields inherited from class cryptix.message.stream.MessageOutputStream
spi
 
Constructor Summary
protected SignedMessageOutputStream(MessageOutputStreamSpi spi, java.security.Provider provider, java.lang.String format)
          Create a new SignedMessageOutputStream object containing the given SPI object.
 
Method Summary
 void addSigner(KeyBundle signingkey, char[] passphrase)
          Adds a signer from a keybundle, decrypting it with the given passphrase.
 void addSigner(java.security.PrivateKey signingkey)
          Adds a signer
static SignedMessageOutputStream getInstance(java.lang.String format)
          Returns an SignedMessageOutputStream that implements the given format.
static SignedMessageOutputStream getInstance(java.lang.String format, java.security.Provider provider)
          Returns an SignedMessageOutputStream from the given provider that implements the given format.
static SignedMessageOutputStream getInstance(java.lang.String format, java.lang.String provider)
          Returns an SignedMessageOutputStream from the given provider that implements the given format.
 
Methods inherited from class cryptix.message.stream.MessageOutputStream
close, flush, getFormat, getProvider, getSpi, init, setAttribute, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SignedMessageOutputStream

protected SignedMessageOutputStream(MessageOutputStreamSpi spi,
                                    java.security.Provider provider,
                                    java.lang.String format)
Create a new SignedMessageOutputStream object containing the given SPI object.

Method Detail

getInstance

public static SignedMessageOutputStream getInstance(java.lang.String format)
                                             throws java.security.NoSuchAlgorithmException
Returns an SignedMessageOutputStream that implements the given format.

Throws:
java.security.NoSuchAlgorithmException

getInstance

public static SignedMessageOutputStream getInstance(java.lang.String format,
                                                    java.lang.String provider)
                                             throws java.security.NoSuchAlgorithmException,
                                                    java.security.NoSuchProviderException
Returns an SignedMessageOutputStream from the given provider that implements the given format.

Throws:
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException

getInstance

public static SignedMessageOutputStream getInstance(java.lang.String format,
                                                    java.security.Provider provider)
                                             throws java.security.NoSuchAlgorithmException
Returns an SignedMessageOutputStream from the given provider that implements the given format.

Throws:
java.security.NoSuchAlgorithmException

addSigner

public final void addSigner(java.security.PrivateKey signingkey)
                     throws java.lang.IllegalStateException,
                            java.io.IOException,
                            MessageStreamException
Adds a signer

Throws:
InvalidStateException - if this message has not been initialized properly or if data has already been streamed
java.io.IOException - on a general IOException that is not format specific.
MessageStreamException - on a variety of format specific problems.
java.lang.IllegalStateException

addSigner

public final void addSigner(KeyBundle signingkey,
                            char[] passphrase)
                     throws java.lang.IllegalStateException,
                            java.io.IOException,
                            MessageStreamException,
                            java.security.UnrecoverableKeyException
Adds a signer from a keybundle, decrypting it with the given passphrase.

Throws:
InvalidStateException - if this message has not been initialized properly or if data has already been streamed
java.io.IOException - on a general IOException that is not format specific.
MessageStreamException - on a variety of format specific problems.
java.security.UnrecoverableKeyException - if the private key cannot be retrieved from the keybundle (for example because of an incorrect passphrase).
java.lang.IllegalStateException

Cryptix OpenPGP

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