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.
Version:
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(BigInteger val) - Encodes an MPI into the message.
|
void | writePrivateKey(PrivateKey k) - Encodes a private key into the message.
|
void | writePublicKey(PublicKey k) - Encodes a public key into the message.
|
void | writeString(String s) - Encodes a string into the message.
|
OutgoingMessage
public OutgoingMessage()
toByteArray
public byte[] toByteArray()
throws KeyAgreementException
Returns the encoded form of the current message including the 4-byte
length header.
KeyAgreementException
- if an encoding size constraint is violated.
writePrivateKey
public void writePrivateKey(PrivateKey k)
throws KeyAgreementException
Encodes a private key into the message.
k
- the private key to encode.
KeyAgreementException
- if an encoding size constraint is violated.
writePublicKey
public void writePublicKey(PublicKey k)
throws KeyAgreementException
Encodes a public key into the message.
k
- the public key to encode.
KeyAgreementException
- if an encoding size constraint is violated.
writeString
public void writeString(String s)
throws KeyAgreementException
Encodes a string into the message.
s
- the string to encode.
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.