0
|
1 package com.trilead.ssh2.packets;
|
|
2
|
|
3 /**
|
|
4 * PacketKexDHInit.
|
|
5 *
|
|
6 * @author Christian Plattner, plattner@trilead.com
|
|
7 * @version $Id: PacketKexDHInit.java,v 1.1 2007/10/15 12:49:55 cplattne Exp $
|
|
8 */
|
|
9 public class PacketKexDHInit {
|
|
10 byte[] payload;
|
|
11
|
|
12 byte[] publicKey;
|
|
13
|
|
14 public PacketKexDHInit(byte[] publicKey) {
|
|
15 this.publicKey = publicKey;
|
|
16 }
|
|
17
|
|
18 public byte[] getPayload() {
|
|
19 if (payload == null) {
|
|
20 TypesWriter tw = new TypesWriter();
|
|
21 tw.writeByte(Packets.SSH_MSG_KEXDH_INIT);
|
|
22 tw.writeString(publicKey, 0, publicKey.length);
|
|
23 payload = tw.getBytes();
|
|
24 }
|
|
25
|
|
26 return payload;
|
|
27 }
|
|
28 }
|