webfunds.sox
Class Utils
java.lang.Object
|
+--webfunds.sox.Utils
- public final class Utils
- extends java.lang.Object
A set of utility functions.
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
getDataFromFile
public static byte[] getDataFromFile(java.lang.String filename)
throws java.io.IOException
- Read a file into a byte array
- Parameters:
filename - The filename containing the data- Returns:
- The byte array read from the file
byteEquals
public static boolean byteEquals(byte[] one,
byte[] two)
- Read a PrivateKey object from a file
- Parameters:
filename - The filename containing the certificate- Returns:
- The PrivateKey from the file
exampleByte
public static byte exampleByte()
- Return data byte(s) that is rubbish.
None of these routines are cryptographically secure,
in fact they are not even vaguely random, and only
intended for class unit tests.
- Returns:
- an example byte
exampleLong
public static long exampleLong()
- Returns:
- example long, made of 8 example bytes
exampleData
public static byte[] exampleData(int len)
- Returns:
- byte array with len example bytes in it, never null
exampleData
public static byte[] exampleData()
- Returns:
- unprintable byte array from 0 to 32 bytes long, never null
exampleString
public static java.lang.String exampleString(int len)
- Returns:
- printable string len bytes long, never null
exampleString
public static java.lang.String exampleString()
- Returns:
- printable string from 0 to 32 bytes long, never null
examplePublicKey
public static java.security.PublicKey examplePublicKey()
- Don't try and do public key on this!
examplePrivateKey
public static java.security.PrivateKey examplePrivateKey()
examplePosBigInt
public static java.math.BigInteger examplePosBigInt(int len)
- Parameters:
len - bytes, where len >= 1
examplePosBigInt
public static java.math.BigInteger examplePosBigInt()
- Returns:
- something from 8 bytes to 16 bytes worth of big int.