Class Passphrase


  • public class Passphrase
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Passphrase​(char[] chars)
      Passphrase for keys etc.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Overwrite the char array with spaces and mark the Passphrase as invalidated.
      static Passphrase emptyPassphrase()
      Represents a Passphrase instance that represents no password.
      char[] getChars()
      Return a copy of the underlying char array.
      boolean isValid()
      Return true if the passphrase has not yet been cleared.
      • Methods inherited from class java.lang.Object

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

      • Passphrase

        public Passphrase​(@Nullable
                          char[] chars)
        Passphrase for keys etc.
        Parameters:
        chars - may be null for empty passwords.
    • Method Detail

      • clear

        public void clear()
        Overwrite the char array with spaces and mark the Passphrase as invalidated.
      • getChars

        @Nullable
        public char[] getChars()
        Return a copy of the underlying char array. A return value of null represents no password.
        Returns:
        passphrase chars.
        Throws:
        java.lang.IllegalStateException - in case the password has been cleared at this point.
      • isValid

        public boolean isValid()
        Return true if the passphrase has not yet been cleared.
        Returns:
        valid
      • emptyPassphrase

        public static Passphrase emptyPassphrase()
        Represents a Passphrase instance that represents no password.
        Returns:
        empty passphrase