net.jradius.tls
Class TlsUtils

java.lang.Object
  extended by net.jradius.tls.TlsUtils

public class TlsUtils
extends Object

Some helper fuctions for MicroTLS.


Constructor Summary
TlsUtils()
           
 
Method Summary
protected static void checkVersion(byte[] readVersion, TlsProtocolHandler handler)
           
protected static void checkVersion(InputStream is, TlsProtocolHandler handler)
           
protected static byte[] PRF(byte[] secret, String asciiLabel, byte[] seed, int size)
           
protected static void readFully(byte[] buf, InputStream is)
           
protected static byte[] readOpaque16(InputStream is)
           
protected static byte[] readOpaque8(InputStream is)
           
protected static int readUint16(InputStream is)
           
protected static int readUint24(InputStream is)
           
protected static long readUint32(InputStream is)
           
protected static short readUint8(InputStream is)
           
static String toByteArray(String string)
           
protected static void writeGMTUnixTime(byte[] buf, int offset)
           
protected static void writeOpaque16(byte[] buf, OutputStream os)
           
protected static void writeOpaque24(byte[] buf, OutputStream os)
           
protected static void writeOpaque8(byte[] buf, OutputStream os)
           
protected static void writeUint16(int i, byte[] buf, int offset)
           
protected static void writeUint16(int i, OutputStream os)
           
protected static void writeUint24(int i, byte[] buf, int offset)
           
protected static void writeUint24(int i, OutputStream os)
           
protected static void writeUint32(long i, byte[] buf, int offset)
           
protected static void writeUint32(long i, OutputStream os)
           
protected static void writeUint64(long i, byte[] buf, int offset)
           
protected static void writeUint64(long i, OutputStream os)
           
protected static void writeUint8(short i, byte[] buf, int offset)
           
protected static void writeUint8(short i, OutputStream os)
           
protected static void writeVersion(byte[] buf, int offset)
           
protected static void writeVersion(OutputStream os)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TlsUtils

public TlsUtils()
Method Detail

writeUint8

protected static void writeUint8(short i,
                                 OutputStream os)
                          throws IOException
Throws:
IOException

writeUint8

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

writeUint16

protected static void writeUint16(int i,
                                  OutputStream os)
                           throws IOException
Throws:
IOException

writeUint16

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

writeUint24

protected static void writeUint24(int i,
                                  OutputStream os)
                           throws IOException
Throws:
IOException

writeUint24

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

writeUint32

protected static void writeUint32(long i,
                                  OutputStream os)
                           throws IOException
Throws:
IOException

writeUint32

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

writeUint64

protected static void writeUint64(long i,
                                  OutputStream os)
                           throws IOException
Throws:
IOException

writeUint64

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

writeOpaque8

protected static void writeOpaque8(byte[] buf,
                                   OutputStream os)
                            throws IOException
Throws:
IOException

writeOpaque16

protected static void writeOpaque16(byte[] buf,
                                    OutputStream os)
                             throws IOException
Throws:
IOException

writeOpaque24

protected static void writeOpaque24(byte[] buf,
                                    OutputStream os)
                             throws IOException
Throws:
IOException

readUint8

protected static short readUint8(InputStream is)
                          throws IOException
Throws:
IOException

readUint16

protected static int readUint16(InputStream is)
                         throws IOException
Throws:
IOException

readUint24

protected static int readUint24(InputStream is)
                         throws IOException
Throws:
IOException

readUint32

protected static long readUint32(InputStream is)
                          throws IOException
Throws:
IOException

readFully

protected static void readFully(byte[] buf,
                                InputStream is)
                         throws IOException
Throws:
IOException

readOpaque8

protected static byte[] readOpaque8(InputStream is)
                             throws IOException
Throws:
IOException

readOpaque16

protected static byte[] readOpaque16(InputStream is)
                              throws IOException
Throws:
IOException

checkVersion

protected static void checkVersion(byte[] readVersion,
                                   TlsProtocolHandler handler)
                            throws IOException
Throws:
IOException

checkVersion

protected static void checkVersion(InputStream is,
                                   TlsProtocolHandler handler)
                            throws IOException
Throws:
IOException

writeGMTUnixTime

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

writeVersion

protected static void writeVersion(OutputStream os)
                            throws IOException
Throws:
IOException

writeVersion

protected static void writeVersion(byte[] buf,
                                   int offset)
                            throws IOException
Throws:
IOException

PRF

protected static byte[] PRF(byte[] secret,
                            String asciiLabel,
                            byte[] seed,
                            int size)

toByteArray

public static String toByteArray(String string)


Copyright © 2011 Coova Technologies, LLC, All Rights Reserved.