Interface Pem.Passphrase

All Superinterfaces:
AutoCloseable
Enclosing class:
Pem

public static interface Pem.Passphrase
Holds a passphrase using a try-with-resources model to assure the passphrase plain-text is erased once it has been used
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Must erase the contents of the passphrase
    <T> T
    map(Function<char[],T> mapper)
    Map the passphrase to an instance of the desired type
    An instance that represents the absence of a passphrase
    of(char[] content)
    Produce a Passphrase for the specified character array.
  • Method Details

    • none

      static Pem.Passphrase none()
      An instance that represents the absence of a passphrase
      Returns:
      Passphrase instance
    • of

      static Pem.Passphrase of(char[] content)
      Produce a Passphrase for the specified character array. The caller is responsible for erasing the contents of the supplied array.
      Parameters:
      content - The passphrase
      Returns:
      Passphrase instance
    • close

      void close()
      Must erase the contents of the passphrase
      Specified by:
      close in interface AutoCloseable
    • map

      <T> T map(Function<char[],T> mapper)
      Map the passphrase to an instance of the desired type
      Type Parameters:
      T - The instance type
      Parameters:
      mapper - The mapping function
      Returns:
      The mapped instance