com.ibm.crypto.hdwrCCA.provider

Class LabelUtils

  • java.lang.Object
    • com.ibm.crypto.hdwrCCA.provider.LabelUtils


  • public final class LabelUtils
    extends java.lang.Object
    This 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.String genLabelName()
      Generates a label for an entry in the CCA key repository.
      protected static boolean isLabel(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 pads label to 64 characters using blank characters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LabelUtils

        public LabelUtils()
    • 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 argument encoding.
        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 pads label to 64 characters using blank characters. The label must be passed in the encoding specified by the argument encoding.
        Parameters:
        label - The byte array to pad. This label must be in the encoding as specified by the encoding argument.
        encoding - The character encoding that the label argument 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 encoding argument.
        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.
� Portions Copyright 1997, 2022 IBM Corporation. All rights reserved. � Portions Copyright 1997, 2022, Oracle and/or its affiliates. All rights reserved.