org.bouncycastle.crypto.tls

Class TlsUtils

public class TlsUtils extends Object

Some helper fuctions for MicroTLS.
Method Summary
protected static voidcheckVersion(byte[] readVersion, TlsProtocolHandler handler)
protected static voidcheckVersion(InputStream is, TlsProtocolHandler handler)
protected static voidPRF(byte[] secret, byte[] label, byte[] seed, byte[] buf)
protected static voidreadFully(byte[] buf, InputStream is)
protected static intreadUint16(InputStream is)
protected static intreadUint24(InputStream is)
protected static longreadUint32(InputStream is)
protected static shortreadUint8(InputStream is)
protected static voidwriteUint16(int i, OutputStream os)
protected static voidwriteUint16(int i, byte[] buf, int offset)
protected static voidwriteUint24(int i, OutputStream os)
protected static voidwriteUint24(int i, byte[] buf, int offset)
protected static voidwriteUint32(long i, OutputStream os)
protected static voidwriteUint32(long i, byte[] buf, int offset)
protected static voidwriteUint64(long i, OutputStream os)
protected static voidwriteUint64(long i, byte[] buf, int offset)
protected static voidwriteUint8(short i, OutputStream os)
protected static voidwriteUint8(short i, byte[] buf, int offset)
protected static voidwriteVersion(OutputStream os)

Method Detail

checkVersion

protected static void checkVersion(byte[] readVersion, TlsProtocolHandler handler)

checkVersion

protected static void checkVersion(InputStream is, TlsProtocolHandler handler)

PRF

protected static void PRF(byte[] secret, byte[] label, byte[] seed, byte[] buf)

readFully

protected static void readFully(byte[] buf, InputStream is)

readUint16

protected static int readUint16(InputStream is)

readUint24

protected static int readUint24(InputStream is)

readUint32

protected static long readUint32(InputStream is)

readUint8

protected static short readUint8(InputStream is)

writeUint16

protected static void writeUint16(int i, OutputStream os)

writeUint16

protected static void writeUint16(int i, byte[] buf, int offset)

writeUint24

protected static void writeUint24(int i, OutputStream os)

writeUint24

protected static void writeUint24(int i, byte[] buf, int offset)

writeUint32

protected static void writeUint32(long i, OutputStream os)

writeUint32

protected static void writeUint32(long i, byte[] buf, int offset)

writeUint64

protected static void writeUint64(long i, OutputStream os)

writeUint64

protected static void writeUint64(long i, byte[] buf, int offset)

writeUint8

protected static void writeUint8(short i, OutputStream os)

writeUint8

protected static void writeUint8(short i, byte[] buf, int offset)

writeVersion

protected static void writeVersion(OutputStream os)