|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.realtime.xmpp.util.HandshakeRequest
Simple class to represent the Handshake XMPP packet for Jabber accept components. An init() method has been included to allow a server to check if a handshake can be created before initiating communications with the Jabber server.
Field Summary | |
protected static java.lang.String[] |
HEX_CHARS
Simple hex table lookup for converting nybbles to characters. |
protected static java.security.MessageDigest |
m_messageDigest
Our SHA1 encoder. |
protected java.lang.String |
m_sPacket
Our SHA1 hashed handshake. |
Constructor Summary | |
HandshakeRequest(java.lang.String sSessionId,
java.lang.String sSecret)
Create a handshake for a given session id and secret. |
Method Summary | |
java.lang.String |
asXML()
Provide a string representation of the XMPP packet. |
java.lang.String |
getId()
Handshake packets do not have an id field. |
java.lang.String |
hash(java.lang.String sIn)
Generate a SHA1 hash of the string. |
static void |
init()
Initialize the handshake generator. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static java.lang.String[] HEX_CHARS
protected java.lang.String m_sPacket
protected static java.security.MessageDigest m_messageDigest
Constructor Detail |
public HandshakeRequest(java.lang.String sSessionId, java.lang.String sSecret)
Create a handshake for a given session id and secret. Note that you should call verify() at some point to make sure the hash encoder is available.
If the message digest algorithm is not available, and an instance of this class is created, then the handshake packet will contain an error message.
sSessionId
- The streams session id that was provided
with the opening <stream:stream> element.
* @param sSecret The secret used to validate with the server.Method Detail |
public static void init() throws java.security.NoSuchAlgorithmException
Initialize the handshake generator.
java.security.NoSuchAlgorithmException
- Generated when the SHA1 digest
is unavailable.public java.lang.String getId()
Handshake packets do not have an id field.
getId
in interface XmppQuery
public java.lang.String asXML()
Provide a string representation of the XMPP packet.
asXML
in interface XmppStanza
public java.lang.String hash(java.lang.String sIn)
Generate a SHA1 hash of the string.
sIn
- The string to hash.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |