gnu.crypto.key
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. |
| 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. |
Returns the encoded form of the current message including the 4-byte length header.
Throws: KeyAgreementException if an encoding size constraint is violated.
Returns the encoded form of the current message excluding the 4-byte length header.
Throws: KeyAgreementException if an encoding size constraint is violated.
Encodes an MPI into the message.
Parameters: val the MPI to encode.
Throws: KeyAgreementException if an encoding size constraint is violated.
Encodes a private key into the message.
Parameters: k the private key to encode.
Throws: KeyAgreementException if an encoding size constraint is violated.
Encodes a public key into the message.
Parameters: k the public key to encode.
Throws: KeyAgreementException if an encoding size constraint is violated.
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.