net.kano.joscar.snaccmd.auth
Class KeyResponse

java.lang.Object
  extended bySnacCommand
      extended byAuthCommand
          extended byKeyResponse

public class KeyResponse
extends AuthCommand

A command sent in response to KeyRequest that provides the user with an "authorization key."

See Also:
KeyRequest
Source of this SNAC:
AIM server
SNAC command type:
Family 0x17, command 0x07

Field Summary
 
Fields inherited from class AuthCommand
CMD_AUTH_REQ, CMD_AUTH_RESP, CMD_KEY_REQ, CMD_KEY_RESP, FAMILY_AUTH, FAMILY_INFO
 
Fields inherited from class SnacCommand
SNACFLAG_DEFAULT
 
Constructor Summary
  KeyResponse(ByteBlock key)
          Creates an outgoing key response command with the given key.
protected KeyResponse(SnacPacket packet)
          Generates a key response command from the given incoming SNAC packet.
 
Method Summary
 ByteBlock getKey()
          Returns the authorization key provided in this response.
 java.lang.String toString()
           
 void writeData(java.io.OutputStream out)
          Writes this command's SNAC data block to the given stream.
 
Methods inherited from class SnacCommand
getCommand, getFamily, getFlag1, getFlag2
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyResponse

protected KeyResponse(SnacPacket packet)
Generates a key response command from the given incoming SNAC packet.

Parameters:
packet - a key response packet

KeyResponse

public KeyResponse(ByteBlock key)
Creates an outgoing key response command with the given key.

Parameters:
key - the "authorization key" to send
Method Detail

getKey

public final ByteBlock getKey()
Returns the authorization key provided in this response.

Returns:
an "authorization key" for use in authorizing

writeData

public void writeData(java.io.OutputStream out)
               throws java.io.IOException
Description copied from class: SnacCommand
Writes this command's SNAC data block to the given stream. The SNAC data block is the data after the first ten bytes of a SNAC packet.

Specified by:
writeData in class SnacCommand
Parameters:
out - the stream to which to write the SNAC data
Throws:
java.io.IOException - if an I/O error occurs

toString

public java.lang.String toString()