All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----is.hi.logir.cryptonite.Cryptonite
random
is used by descendants of this class to
generate random numbers.
a
as a
string of binary digits.
a
as a
string of binary digits.
n
.
hex
.
a
as a
string of hexadecimal digits.
buf
as a string of
hexadecimal digits.
a
as a
string of hexadecimal digits.
a
as a
string of hexadecimal digits.
buf[i..i+length-1]
into a long.
t
until a non-space character
is reached and return that character.
a
.
a
.
in
in bigendian order.
dest[i..i+length-1]
.
x
to out
in bigendian order.
public static Random random
random
is used by descendants of this class to
generate random numbers. It should be a cryptographically secure
random number generator, preferably without any period, which
rules out all generators based on iterated functions, such as
java.util.Random.
If the file /dev/random
exists, random
is initialized set an instance of the RandomFromReader class
which read that file. Otherwise it is initialized to an instance
of the RandomSpinner class.
public static int primeCertainty
The default value of 32 will give a false prime less than once in every 4,000,000,000 tries.
public static KeySource keySource
lookup(fingerprint)
CDS.
public static char NIBBLE[]
public static char BIT[]
public Cryptonite()
public static final long makeLong(byte buf[], int i, int length)
buf[i..i+length-1]
into a long.
public static final void writeBytes(long a, byte dest[], int i, int length)
dest[i..i+length-1]
.
public static final int pickBits(int a, byte bits[])
a
. The number in
bits[i]
is the index of the bit within a
that should be put at index i
in the result.
The most-significant bit is number 0.
public static final long pickBits(long a, byte bits[])
a
. The number in
bits[i]
is the index of the bit within a
that should be put at index i
in the result.
The most-significant bit is number 0.
public static final String hexString(byte buf[])
buf
as a string of
hexadecimal digits.
public static final String hexString(long a)
a
as a
string of hexadecimal digits.
public static final String hexString(int a)
a
as a
string of hexadecimal digits.
public static final String hexString(byte a)
a
as a
string of hexadecimal digits.
public static byte fromHexNibble(char n)
n
.
public static byte[] fromHexString(String hex)
hex
.
public static final String binString(long a)
a
as a
string of binary digits.
public static final String binString(int a)
a
as a
string of binary digits.
public static boolean equal(byte a[], byte b[])
public static boolean equalRelaxed(byte a[], byte b[])
public static final void writeInt(OutputStream out, int x) throws IOException
x
to out
in bigendian order.
public static final int readInt(InputStream in) throws IOException
in
in bigendian order.
public static CipherKey makeSessionKey(String keyType, byte bits[]) throws InvalidCDSException
public static int pastSpace(Reader r) throws IOException
t
until a non-space character
is reached and return that character.
public static Object fromString(Reader cds) throws InvalidCDSException, IOException
toString()
methods and return the
described object.
The CDS syntax is one of:
ClassName(parameters)
lookup(fingerprint)
ClassName
is the name of a class to generate. By default
the string "is.hi.logir.cryptonite."
is prepended to the
class name and an instance created with the ClassName(String)
constructor. See the documentation for various classes for
details.
The lookup(fingerprint)
CDS assumes fingerprint
to be a CDS for a Fingerprint object. It then looks up the key with the
specified fingerprint in the keySource
.
This method may throw exceptions with very long, nested explanations if an exception occurs in a sub-CDS.
in
public static Object fromString(String cds) throws InvalidCDSException
public static String prettyCDS(String cds)
All Packages Class Hierarchy This Package Previous Next Index