Class KeyMaterialHolder

java.lang.Object
de.cuioss.tools.net.ssl.KeyMaterialHolder
All Implemented Interfaces:
Serializable

public final class KeyMaterialHolder extends Object implements Serializable
Runtime representation of key-material. The actual key is provided as byte[]. An optional keyPassword is available as well.
Author:
Oliver Wolff
See Also:
  • Constructor Details

  • Method Details

    • getKeyPasswordAsCharArray

      public char[] getKeyPasswordAsCharArray()
      Returns:
      NPE-safe char-array representation of #getKeyPassword(). If keyPassword is null or empty it returns an empty char[], never null
    • deserializeKeyMaterial

      public static byte[] deserializeKeyMaterial(String serializedKeyMaterial)
      Parameters:
      serializedKeyMaterial - the Base64 encoded key material
      Returns:
      Raw i.e. original key material
      Throws:
      IllegalArgumentException - if serializedKeyMaterial is not Base64 encoded
    • serializeKeyMaterial

      public static String serializeKeyMaterial(byte[] keyMaterial)
      Parameters:
      keyMaterial - Raw i.e. original key material
      Returns:
      Base64 encoded key material