Class Passphrase

    • 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:
        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
      • isEmpty

        public boolean isEmpty()
        Return true if the passphrase represents no password.
        Returns:
        empty