1 2 package ch.ethz.ssh2.packets; 3 4 10 public class PacketUserauthRequestInteractive 11 { 12 byte[] payload; 13 14 String userName; 15 String serviceName; 16 String [] submethods; 17 18 public PacketUserauthRequestInteractive(String serviceName, String user, String [] submethods) 19 { 20 this.serviceName = serviceName; 21 this.userName = user; 22 this.submethods = submethods; 23 } 24 25 public byte[] getPayload() 26 { 27 if (payload == null) 28 { 29 TypesWriter tw = new TypesWriter(); 30 tw.writeByte(Packets.SSH_MSG_USERAUTH_REQUEST); 31 tw.writeString(userName); 32 tw.writeString(serviceName); 33 tw.writeString("keyboard-interactive"); 34 tw.writeString(""); tw.writeNameList(submethods); 37 38 payload = tw.getBytes(); 39 } 40 return payload; 41 } 42 } 43 | Popular Tags |