org.bouncycastle.crypto.tls
Class TlsUtils
java.lang.Object
org.bouncycastle.crypto.tls.TlsUtils
public class TlsUtils
- extends java.lang.Object
Some helper fuctions for MicroTLS.
Method Summary |
protected static void |
checkVersion(byte[] readVersion,
TlsProtocolHandler handler)
|
protected static void |
checkVersion(java.io.InputStream is,
TlsProtocolHandler handler)
|
protected static byte[] |
PRF(byte[] secret,
java.lang.String asciiLabel,
byte[] seed,
int size)
|
protected static void |
readFully(byte[] buf,
java.io.InputStream is)
|
protected static byte[] |
readOpaque16(java.io.InputStream is)
|
protected static byte[] |
readOpaque8(java.io.InputStream is)
|
protected static int |
readUint16(java.io.InputStream is)
|
protected static int |
readUint24(java.io.InputStream is)
|
protected static long |
readUint32(java.io.InputStream is)
|
protected static short |
readUint8(java.io.InputStream is)
|
protected static void |
writeGMTUnixTime(byte[] buf,
int offset)
|
protected static void |
writeOpaque16(byte[] buf,
java.io.OutputStream os)
|
protected static void |
writeOpaque24(byte[] buf,
java.io.OutputStream os)
|
protected static void |
writeOpaque8(byte[] buf,
java.io.OutputStream os)
|
protected static void |
writeUint16(int i,
byte[] buf,
int offset)
|
protected static void |
writeUint16(int i,
java.io.OutputStream os)
|
protected static void |
writeUint16Array(int[] uints,
java.io.OutputStream os)
|
protected static void |
writeUint24(int i,
byte[] buf,
int offset)
|
protected static void |
writeUint24(int i,
java.io.OutputStream os)
|
protected static void |
writeUint32(long i,
byte[] buf,
int offset)
|
protected static void |
writeUint32(long i,
java.io.OutputStream os)
|
protected static void |
writeUint64(long i,
byte[] buf,
int offset)
|
protected static void |
writeUint64(long i,
java.io.OutputStream os)
|
protected static void |
writeUint8(short i,
byte[] buf,
int offset)
|
protected static void |
writeUint8(short i,
java.io.OutputStream os)
|
protected static void |
writeUint8Array(short[] uints,
java.io.OutputStream os)
|
protected static void |
writeVersion(byte[] buf,
int offset)
|
protected static void |
writeVersion(java.io.OutputStream os)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TlsUtils
public TlsUtils()
writeUint8
protected static void writeUint8(short i,
java.io.OutputStream os)
throws java.io.IOException
- Throws:
java.io.IOException
writeUint8
protected static void writeUint8(short i,
byte[] buf,
int offset)
writeUint16
protected static void writeUint16(int i,
java.io.OutputStream os)
throws java.io.IOException
- Throws:
java.io.IOException
writeUint16
protected static void writeUint16(int i,
byte[] buf,
int offset)
writeUint24
protected static void writeUint24(int i,
java.io.OutputStream os)
throws java.io.IOException
- Throws:
java.io.IOException
writeUint24
protected static void writeUint24(int i,
byte[] buf,
int offset)
writeUint32
protected static void writeUint32(long i,
java.io.OutputStream os)
throws java.io.IOException
- Throws:
java.io.IOException
writeUint32
protected static void writeUint32(long i,
byte[] buf,
int offset)
writeUint64
protected static void writeUint64(long i,
java.io.OutputStream os)
throws java.io.IOException
- Throws:
java.io.IOException
writeUint64
protected static void writeUint64(long i,
byte[] buf,
int offset)
writeOpaque8
protected static void writeOpaque8(byte[] buf,
java.io.OutputStream os)
throws java.io.IOException
- Throws:
java.io.IOException
writeOpaque16
protected static void writeOpaque16(byte[] buf,
java.io.OutputStream os)
throws java.io.IOException
- Throws:
java.io.IOException
writeOpaque24
protected static void writeOpaque24(byte[] buf,
java.io.OutputStream os)
throws java.io.IOException
- Throws:
java.io.IOException
writeUint8Array
protected static void writeUint8Array(short[] uints,
java.io.OutputStream os)
throws java.io.IOException
- Throws:
java.io.IOException
writeUint16Array
protected static void writeUint16Array(int[] uints,
java.io.OutputStream os)
throws java.io.IOException
- Throws:
java.io.IOException
readUint8
protected static short readUint8(java.io.InputStream is)
throws java.io.IOException
- Throws:
java.io.IOException
readUint16
protected static int readUint16(java.io.InputStream is)
throws java.io.IOException
- Throws:
java.io.IOException
readUint24
protected static int readUint24(java.io.InputStream is)
throws java.io.IOException
- Throws:
java.io.IOException
readUint32
protected static long readUint32(java.io.InputStream is)
throws java.io.IOException
- Throws:
java.io.IOException
readFully
protected static void readFully(byte[] buf,
java.io.InputStream is)
throws java.io.IOException
- Throws:
java.io.IOException
readOpaque8
protected static byte[] readOpaque8(java.io.InputStream is)
throws java.io.IOException
- Throws:
java.io.IOException
readOpaque16
protected static byte[] readOpaque16(java.io.InputStream is)
throws java.io.IOException
- Throws:
java.io.IOException
checkVersion
protected static void checkVersion(byte[] readVersion,
TlsProtocolHandler handler)
throws java.io.IOException
- Throws:
java.io.IOException
checkVersion
protected static void checkVersion(java.io.InputStream is,
TlsProtocolHandler handler)
throws java.io.IOException
- Throws:
java.io.IOException
writeGMTUnixTime
protected static void writeGMTUnixTime(byte[] buf,
int offset)
writeVersion
protected static void writeVersion(java.io.OutputStream os)
throws java.io.IOException
- Throws:
java.io.IOException
writeVersion
protected static void writeVersion(byte[] buf,
int offset)
throws java.io.IOException
- Throws:
java.io.IOException
PRF
protected static byte[] PRF(byte[] secret,
java.lang.String asciiLabel,
byte[] seed,
int size)