|
For the latest news and information visit The GNU Crypto project |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object extended bygnu.crypto.key.IncomingMessage
An implementation of an incoming message for use with key agreement protocols.
| Field Summary | |
protected java.io.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. |
| Constructor Summary | |
IncomingMessage(byte[] b)
Constructs an incoming message given the message's encoded form, including its header bytes. |
|
| Method Summary | |
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. |
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()
|
java.math.BigInteger |
readMPI()
Decodes an MPI from the current message's contents. |
java.security.PrivateKey |
readPrivateKey()
|
java.security.PublicKey |
readPublicKey()
|
java.lang.String |
readString()
|
static int |
twoBytesToLength(byte[] b)
Converts two octets into the number that they represent. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.io.ByteArrayInputStream in
protected int length
| Constructor Detail |
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.
KeyAgreementException - if the buffer is malformed.| Method Detail |
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.
IncomingMessage.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.
IncomingMessage.public static int twoBytesToLength(byte[] b) throws KeyAgreementException
Converts two octets into the number that they represent.
b - the two octets.
KeyAgreementExceptionpublic static int fourBytesToLength(byte[] b) throws KeyAgreementException
Converts four octets into the number that they represent.
b - the four octets.
KeyAgreementExceptionpublic boolean hasMoreElements()
public java.security.PublicKey readPublicKey() throws KeyAgreementException
KeyAgreementExceptionpublic java.security.PrivateKey readPrivateKey() throws KeyAgreementException
KeyAgreementExceptionpublic java.math.BigInteger readMPI() throws KeyAgreementException
Decodes an MPI from the current message's contents.
KeyAgreementException - if an encoding exception occurs during the
operation.public java.lang.String readString() throws KeyAgreementException
KeyAgreementException
|
For the latest news and information visit The GNU Crypto project |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||