gnu.crypto.key
Class IncomingMessage
public class IncomingMessage
An implementation of an incoming message for use with key agreement
protocols.
protected ByteArrayInputStream | in - The internal buffer stream containing the message's contents.
|
protected int | length - The length of the message contents, according to its 4-byte header.
|
IncomingMessage(byte[] b) - Constructs an incoming message given the message's encoded form,
including its header bytes.
|
static int | fourBytesToLength(byte[] b) - Converts four octets into the number that they represent.
|
static IncomingMessage | getInstance(byte[] raw) - Returns an instance of a message given its encoded contents, excluding
the message's header bytes.
Calls the method with the same name and three arguments as:
getInstance(raw, 0, raw.length) .
|
static IncomingMessage | getInstance(byte[] raw, int offset, int len) - Returns an instance of a message given its encoded contents, excluding
the message's header bytes.
|
boolean | hasMoreElements()
|
BigInteger | readMPI() - Decodes an MPI from the current message's contents.
|
PrivateKey | readPrivateKey()
|
PublicKey | readPublicKey()
|
String | readString()
|
static int | twoBytesToLength(byte[] b) - Converts two octets into the number that they represent.
|
in
protected ByteArrayInputStream in
The internal buffer stream containing the message's contents.
length
protected int length
The length of the message contents, according to its 4-byte header.
IncomingMessage
public IncomingMessage(byte[] b)
throws KeyAgreementException
Constructs an incoming message given the message's encoded form,
including its header bytes.
b
- the encoded form, including the header bytes, of an incoming
message.
fourBytesToLength
public static int fourBytesToLength(byte[] b)
throws KeyAgreementException
Converts four octets into the number that they represent.
getInstance
public static IncomingMessage getInstance(byte[] raw)
Returns an instance of a message given its encoded contents, excluding
the message's header bytes.
Calls the method with the same name and three arguments as:
getInstance(raw, 0, raw.length)
.
raw
- the encoded form, excluding the header bytes.
- a new instance of
IncomingMessage
.
getInstance
public static IncomingMessage getInstance(byte[] raw,
int offset,
int len)
Returns an instance of a message given its encoded contents, excluding
the message's header bytes.
raw
- the encoded form, excluding the header bytes.offset
- offset where to start using raw bytes from.len
- number of bytes to use.
- a new instance of
IncomingMessage
.
hasMoreElements
public boolean hasMoreElements()
readMPI
public BigInteger readMPI()
throws KeyAgreementException
Decodes an MPI from the current message's contents.
- a native representation of an MPI.
twoBytesToLength
public static int twoBytesToLength(byte[] b)
throws KeyAgreementException
Converts two octets into the number that they represent.
Copyright © 2001, 2002, 2003
Free Software Foundation,
Inc. All Rights Reserved.