RFR: 8366261: Provide utility methods for sun.security.util.Password

Chen Liang liach at openjdk.org
Wed Aug 27 23:33:42 UTC 2025


On Wed, 27 Aug 2025 22:53:28 GMT, Naoto Sato <naoto at openjdk.org> wrote:

> Providing a couple of utility methods using the "built-in" `Console` implementation to support tools that require password input, such as `keytool`, ensuring they work even when stdin is redirected.

src/java.base/share/classes/java/io/Console.java line 555:

> 553:     static final int TTY_STDIN_MASK = 0x00000001;
> 554:     static final int TTY_STDOUT_MASK = 0x00000002;
> 555:     static final int TTY_STDERR_MASK = 0x00000004;

I recommend marking these fields as `@Native`.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/26973#discussion_r2305554204


More information about the security-dev mailing list