For the latest news and information visit The GNU Crypto project

## gnu.crypto.key
Class OutgoingMessage

    java.lang.Object
      |
      +--gnu.crypto.key.OutgoingMessage

public class OutgoingMessage
extends java.lang.Object

An implementation of outgoing messages for use with key agreement protocols.

Constructor Summary
`OutgoingMessage()`

Method Summary
`byte[]` `toByteArray()` Returns the encoded form of the current message including the 4-byte length header.
`byte[]` `wrap()` Returns the encoded form of the current message excluding the 4-byte length header.
`void` `writeMPI(java.math.BigInteger val)` Encodes an MPI into the message.
`void` `writePrivateKey(java.security.PrivateKey k)` Encodes a private key into the message.
`void` `writePublicKey(java.security.PublicKey k)` Encodes a public key into the message.
`void` `writeString(java.lang.String s)` Encodes a string into the message.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### OutgoingMessage

    public OutgoingMessage()

Method Detail

### toByteArray

    public byte[] toByteArray()
                       throws KeyAgreementException

  Returns the encoded form of the current message including the 4-byte length header.

  Throws:
    `KeyAgreementException` - if an encoding size constraint is violated.

### wrap

    public byte[] wrap()
                throws KeyAgreementException

  Returns the encoded form of the current message excluding the 4-byte length header.

  Throws:
    `KeyAgreementException` - if an encoding size constraint is violated.

### writePublicKey

    public void writePublicKey(java.security.PublicKey k)
                        throws KeyAgreementException

  Encodes a public key into the message.

  Parameters:
    `k` - the public key to encode.
  Throws:
    `KeyAgreementException` - if an encoding size constraint is violated.

### writePrivateKey

    public void writePrivateKey(java.security.PrivateKey k)
                         throws KeyAgreementException

  Encodes a private key into the message.

  Parameters:
    `k` - the private key to encode.
  Throws:
    `KeyAgreementException` - if an encoding size constraint is violated.

### writeMPI

    public void writeMPI(java.math.BigInteger val)
                  throws KeyAgreementException

  Encodes an MPI into the message.

  Parameters:
    `val` - the MPI to encode.
  Throws:
    `KeyAgreementException` - if an encoding size constraint is violated.

### writeString

    public void writeString(java.lang.String s)
                     throws KeyAgreementException

  Encodes a string into the message.

  Parameters:
    `s` - the string to encode.
  Throws:
    `KeyAgreementException` - if the UTF8 encoding is not supported on this platform, or if an encoding size constraint is violated.

For the latest news and information visit The GNU Crypto project

Copyright © 2001, 2002, 2003, 2004 Free Software Foundation, Inc.