RFR: 8225181: KeyStore should have a getAttributes method [v2]

Sean Mullan mullan at openjdk.java.net
Tue Nov 2 15:21:13 UTC 2021


On Thu, 28 Oct 2021 16:58:47 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> Add `KeyStore::getAttributes` so that one can get the attributes of an entry without retrieving the entry first. This is especially useful for a private key entry which can only be retrieved with a password.
>
> Weijun Wang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   clarification on protected attributes

src/java.base/share/classes/java/security/KeyStore.java line 1030:

> 1028:      *
> 1029:      * @param alias the alias name
> 1030:      * @return an unmodifiable {@code Set} of attributes, possibly empty

If the alias does not exist, then is it definitely always empty? I think the word "possibly" here may be a bit misleading. Maybe reword this as:
"an unmodifiable {@code Set} of attributes." This set is empty if the given alias does not exist or there are no attributes associated with the alias. This set may also be empty for PrivateKeyEntry or SecretKeyEntry entries that contain protected attributes and are only available through the ... "

src/java.base/share/classes/java/security/KeyStore.java line 1031:

> 1029:      * @param alias the alias name
> 1030:      * @return an unmodifiable {@code Set} of attributes, possibly empty
> 1031:      *      if the given alias does not exist, or there is no

s/is no/are no/

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

PR: https://git.openjdk.java.net/jdk/pull/6026



More information about the security-dev mailing list