gnu.crypto.key

Class OutgoingMessage

public class OutgoingMessage extends Object

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

Version: $Revision: 1.2 $

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.

voidwriteMPI(BigInteger val)

Encodes an MPI into the message.

voidwritePrivateKey(PrivateKey k)

Encodes a private key into the message.

voidwritePublicKey(PublicKey k)

Encodes a public key into the message.

voidwriteString(String s)

Encodes a string into the message.

Constructor Detail

OutgoingMessage

public OutgoingMessage()

Method Detail

toByteArray

public byte[] toByteArray()

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()

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

Throws: KeyAgreementException if an encoding size constraint is violated.

writeMPI

public void writeMPI(BigInteger val)

Encodes an MPI into the message.

Parameters: val the MPI to encode.

Throws: KeyAgreementException if an encoding size constraint is violated.

writePrivateKey

public void writePrivateKey(PrivateKey k)

Encodes a private key into the message.

Parameters: k the private key to encode.

Throws: KeyAgreementException if an encoding size constraint is violated.

writePublicKey

public void writePublicKey(PublicKey k)

Encodes a public key into the message.

Parameters: k the public key to encode.

Throws: KeyAgreementException if an encoding size constraint is violated.

writeString

public void writeString(String s)

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.

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.