Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.javax.crypto.key
Class IncomingMessage  view IncomingMessage download IncomingMessage.java

java.lang.Object
  extended bygnu.javax.crypto.key.IncomingMessage

public class IncomingMessage
extends java.lang.Object

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
private IncomingMessage()
          Trivial private constructor for use by the class method.
  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.
private  gnu.java.security.key.IKeyPairCodec getKeyPairCodec(int keyTypeAndFormatID)
           
 boolean hasMoreElements()
           
 java.math.BigInteger readMPI()
          Decodes an MPI from the current message's contents.
 java.security.PrivateKey readPrivateKey()
          Decodes a private key from the message.
 java.security.PublicKey readPublicKey()
          Decodes a public key from the message.
 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

in

protected java.io.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.

Constructor Detail

IncomingMessage

public IncomingMessage(byte[] b)
                throws KeyAgreementException

Constructs an incoming message given the message's encoded form, including its header bytes.


IncomingMessage

private IncomingMessage()
Trivial private constructor for use by the class method.

Method Detail

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


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.


twoBytesToLength

public static int twoBytesToLength(byte[] b)
                            throws KeyAgreementException

Converts two octets into the number that they represent.


fourBytesToLength

public static int fourBytesToLength(byte[] b)
                             throws KeyAgreementException

Converts four octets into the number that they represent.


hasMoreElements

public boolean hasMoreElements()

readPublicKey

public java.security.PublicKey readPublicKey()
                                      throws KeyAgreementException
Decodes a public key from the message.

See OutgoingMessage.writePublicKey(java.security.PublicKey) 55 for more details on the internal format.


readPrivateKey

public java.security.PrivateKey readPrivateKey()
                                        throws KeyAgreementException
Decodes a private key from the message.

See OutgoingMessage.writePrivateKey(java.security.PrivateKey) 55 for more details.


readMPI

public java.math.BigInteger readMPI()
                             throws KeyAgreementException

Decodes an MPI from the current message's contents.


readString

public java.lang.String readString()
                            throws KeyAgreementException

getKeyPairCodec

private gnu.java.security.key.IKeyPairCodec getKeyPairCodec(int keyTypeAndFormatID)
                                                     throws KeyAgreementException