java.lang.Object
com.ibm.crypto.hdwrCCA.provider.LabelUtils
This class provides common processing for symmetric keys
(types AES, DES, DESede).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringGenerates a label for an entry in the CCA key repository.protected static booleanThis method determines if the byte array contains a key label.protected static byte[]This method padslabelto 64 characters using blank characters.
-
Constructor Details
-
LabelUtils
public LabelUtils()Constructor
-
-
Method Details
-
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
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
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:
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.
-