|
For the latest news and information visit The GNU Crypto project |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgnu.crypto.pki.Util
A collection of useful class methods.
Field Summary | |
---|---|
static String |
HEX
|
Constructor Summary | |
---|---|
Util()
|
Method Summary | |
---|---|
static String |
formatInt(int i,
int radix,
int len)
Format an integer into the specified radix, zero-filled. |
static String |
hexDump(byte[] buf,
int off,
int len,
String prefix)
Create a representation of the given byte array similar to the output of `hexdump -C', which is OFFSET SIXTEEN-BYTES-IN-HEX PRINTABLE-BYTES The printable bytes show up as-is if they are printable and not a newline character, otherwise showing as '.'. |
static String |
hexDump(byte[] buf,
String prefix)
See #hexDump(byte[],int,int) . |
static byte[] |
toByteArray(String hex)
Convert a hexadecimal string into its byte representation. |
static String |
toHexString(byte[] buf)
See toHexString(byte[],int,int) . |
static String |
toHexString(byte[] buf,
char sep)
See toHexString(byte[],int,int,char) . |
static String |
toHexString(byte[] buf,
int off,
int len)
Convert a byte array to a hexadecimal string, as though it were a big-endian arbitrarily-sized integer. |
static String |
toHexString(byte[] buf,
int off,
int len,
char sep)
Convert a byte array to a hexadecimal string, separating octets with the given character. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String HEX
Constructor Detail |
public Util()
Method Detail |
public static String toHexString(byte[] buf, int off, int len)
buf
- The bytes to format.off
- The offset to start at.len
- The number of bytes to format.
public static String toHexString(byte[] buf)
toHexString(byte[],int,int)
.
public static String toHexString(byte[] buf, int off, int len, char sep)
buf
- The bytes to format.off
- The offset to start at.len
- The number of bytes to format.sep
- The character to insert between octets.
public static String toHexString(byte[] buf, char sep)
toHexString(byte[],int,int,char)
.
public static String hexDump(byte[] buf, int off, int len, String prefix)
OFFSET SIXTEEN-BYTES-IN-HEX PRINTABLE-BYTES
The printable bytes show up as-is if they are printable and not a newline character, otherwise showing as '.'.
buf
- The bytes to format.off
- The offset to start at.len
- The number of bytes to encode.
public static String hexDump(byte[] buf, String prefix)
#hexDump(byte[],int,int)
.
public static String formatInt(int i, int radix, int len)
i
- The integer to format.radix
- The radix to encode to.len
- The target length of the string. The string is
zero-padded to this length, but may be longer.
public static byte[] toByteArray(String hex)
hex
- The hexadecimal string.
|
For the latest news and information visit The GNU Crypto project |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |