com.ibm.crypto.hdwrCCA.provider
Class LabelUtils
- java.lang.Object
-
- com.ibm.crypto.hdwrCCA.provider.LabelUtils
-
public final class LabelUtils extends java.lang.ObjectThis class provides common processing for symmetric keys (types AES, DES, DESede).
-
-
Constructor Summary
Constructors Constructor and Description LabelUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description protected static java.lang.StringgenLabelName()Generates a label for an entry in the CCA key repository.protected static booleanisLabel(byte[] label, java.nio.charset.Charset encoding)This method determines if the byte array contains a key label.protected static byte[]padLabel(byte[] label, java.nio.charset.Charset encoding)This method padslabelto 64 characters using blank characters.
-
-
-
Method Detail
-
genLabelName
protected static java.lang.String genLabelName()
Generates a label for an entry in the CCA key repository.- Returns:
- the generated label for an entry in the CCA key repository.
-
isLabel
protected static boolean isLabel(byte[] label, java.nio.charset.Charset encoding)This method determines if the byte array contains a key label.- Parameters:
label- The byte array to check if it contains a label. The key label must be in the encoding defined by the argumentencoding.encoding- The encoding that the label is in. Options are IBM1047 or IS0-8859-1 character sets. If a different character set is passed in besides these two values the method will return false.- Returns:
- true if the label is a key label, false otherwise.
-
padLabel
protected static byte[] padLabel(byte[] label, java.nio.charset.Charset encoding)This method padslabelto 64 characters using blank characters. Thelabelmust be passed in the encoding specified by the argumentencoding.- Parameters:
label- The byte array to pad. This label must be in the encoding as specified by theencodingargument.encoding- The character encoding that thelabelargument and the padded return byte array is encoded in.- Returns:
- A new byte array containing the label passed in padded with blank characters for a total length of 64 characters.
This label will be in the encoding as defined by the
encodingargument. - Throws:
java.lang.RuntimeException- when the encoding is not specified as PlatformUtilities.CHARSET_IBM_1047 or PlatformUtilities.CHARSET_ISO_8859_1 or the label is greater than 64 characters.
-
-