com.ibm.security.pkcs12
Class PKCS12Utils
java.lang.Object
|
+--com.ibm.security.pkcs12.PKCS12Utils
- public final class PKCS12Utils
- extends Object
PKCS #12 utility class for ASCII to Unicode (BMP) conversions.
Method Summary |
static byte[] |
ascii2bmp(char[] chars)
Converts a character array into a BMP (Unicode) array. |
static String |
bmp2string(byte[] bmp)
Converts a BMP (Unicode) string into a String. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
ascii2bmp
public static byte[] ascii2bmp(char[] chars)
- Converts a character array into a BMP (Unicode) array.
- Parameters:
str
- the character array to convert.- Returns:
- a BMP (Unicode) byte array equivalent to the input character
array. If the input is null or has zero length, a zero length BMP
byte array will be returned.
bmp2string
public static String bmp2string(byte[] bmp)
- Converts a BMP (Unicode) string into a String. Does NOT include a
terminating null.
- Parameters:
bmp
- the BMP array to convert.- Returns:
- a String equivalent to the input BMP string (but NOT
null-terminiated).
- Throws:
- IllegalArgumentException - if the input array is not in BMP
format.