|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.red5.server.net.rtmp.RTMPHandshake
public abstract class RTMPHandshake
Generates and validates the RTMP handshake response for Flash Players. Client versions equal to or greater than Flash 9,0,124,0 require a nonzero value as the fifth byte of the handshake request.
Field Summary | |
---|---|
protected Cipher |
cipherIn
|
protected Cipher |
cipherOut
|
protected static BigInteger |
DH_BASE
|
protected static BigInteger |
DH_MODULUS
|
protected static byte[] |
DH_MODULUS_BYTES
Modulus bytes from flazr |
protected static int |
DIGEST_LENGTH
|
protected static byte[] |
GENUINE_FMS_KEY
|
protected static byte[] |
GENUINE_FP_KEY
|
static byte[] |
HANDSHAKE_PAD_BYTES
|
protected static int |
HANDSHAKE_SIZE_SERVER
|
protected byte[] |
handshakeBytes
|
protected byte |
handshakeType
|
protected byte[] |
incomingPublicKey
|
protected static int |
KEY_LENGTH
|
protected KeyAgreement |
keyAgreement
|
protected static Logger |
log
|
protected byte[] |
outgoingPublicKey
|
protected static Random |
random
|
protected byte[] |
swfVerificationBytes
|
protected int |
validationScheme
|
Constructor Summary | |
---|---|
RTMPHandshake()
|
Method Summary | |
---|---|
byte[] |
calculateHMAC_SHA256(byte[] input,
byte[] key)
Calculates an HMAC SHA256 hash using a default key length. |
byte[] |
calculateHMAC_SHA256(byte[] input,
byte[] key,
int length)
Calculates an HMAC SHA256 hash using a set key length. |
protected abstract void |
createHandshakeBytes()
Create the initial bytes for a request / response. |
protected KeyPair |
generateKeyPair()
Creates a Diffie-Hellman key pair. |
Cipher |
getCipherIn()
Returns the contained handshake bytes. |
Cipher |
getCipherOut()
Gets the DH offset in the handshake bytes array based on validation scheme Generates DH keypair Adds public key to handshake bytes |
protected int |
getDHOffset(byte[] bytes)
Returns the DH offset from an array of bytes. |
protected int |
getDHOffset0(byte[] bytes)
Returns the DH byte offset. |
protected int |
getDHOffset1(byte[] bytes)
Returns the DH byte offset. |
protected int |
getDigestOffset(byte[] pBuffer)
Returns the digest offset using current validation scheme. |
protected int |
getDigestOffset0(byte[] pBuffer)
Returns a digest byte offset. |
protected int |
getDigestOffset1(byte[] pBuffer)
Returns a digest byte offset. |
byte[] |
getHandshakeBytes()
Creates the servers handshake bytes |
byte |
getHandshakeType()
Returns the handshake type. |
protected static byte[] |
getPublicKey(KeyPair keyPair)
Returns the public key for a given key pair. |
protected static byte[] |
getSharedSecret(byte[] otherPublicKeyBytes,
KeyAgreement agreement)
Determines the validation scheme for given input. |
byte[] |
getSwfVerificationBytes()
Returns the SWF verification bytes. |
void |
setHandshakeType(byte handshakeType)
Sets the handshake type. |
abstract boolean |
validate(IoBuffer input)
Determines the validation scheme for given input. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.red5.server.net.IHandshake |
---|
doHandshake |
Field Detail |
---|
protected static Logger log
public static byte[] HANDSHAKE_PAD_BYTES
protected static final byte[] GENUINE_FMS_KEY
protected static final byte[] GENUINE_FP_KEY
protected static final byte[] DH_MODULUS_BYTES
protected static final BigInteger DH_MODULUS
protected static final BigInteger DH_BASE
protected static final int HANDSHAKE_SIZE_SERVER
protected static final int DIGEST_LENGTH
protected static final int KEY_LENGTH
protected static final Random random
protected KeyAgreement keyAgreement
protected Cipher cipherOut
protected Cipher cipherIn
protected byte handshakeType
protected byte[] handshakeBytes
protected int validationScheme
protected byte[] incomingPublicKey
protected byte[] outgoingPublicKey
protected byte[] swfVerificationBytes
Constructor Detail |
---|
public RTMPHandshake()
Method Detail |
---|
public byte[] calculateHMAC_SHA256(byte[] input, byte[] key)
input
- key
-
public byte[] calculateHMAC_SHA256(byte[] input, byte[] key, int length)
input
- key
- length
-
protected KeyPair generateKeyPair()
protected static byte[] getPublicKey(KeyPair keyPair)
keyPair
-
protected static byte[] getSharedSecret(byte[] otherPublicKeyBytes, KeyAgreement agreement)
otherPublicKeyBytes
- agreement
-
protected abstract void createHandshakeBytes()
public abstract boolean validate(IoBuffer input)
validate
in interface IHandshake
input
-
protected int getDHOffset(byte[] bytes)
bytes
-
protected int getDHOffset0(byte[] bytes)
protected int getDHOffset1(byte[] bytes)
protected int getDigestOffset(byte[] pBuffer)
pBuffer
-
protected int getDigestOffset0(byte[] pBuffer)
pBuffer
- source for digest data
protected int getDigestOffset1(byte[] pBuffer)
pBuffer
- source for digest data
public byte[] getHandshakeBytes()
public void setHandshakeType(byte handshakeType)
handshakeType
- public byte getHandshakeType()
public Cipher getCipherOut()
public Cipher getCipherIn()
public byte[] getSwfVerificationBytes()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |