Re: RFR: 8225181: KeyStore should have a getAttributes method [v5]

2021-12-03 Thread Sean Mullan
On Wed, 1 Dec 2021 01:15:27 GMT, Weijun Wang 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

Re: RFR: 8225181: KeyStore should have a getAttributes method [v5]

2021-12-01 Thread Michael StJohns
On 11/30/2021 10:07 PM, Wei-Jun Wang wrote: My understanding is that Java's PKCS12KeyStore will fabricate an alias string if there is no friendlyName, since every entry inside a KeyStore object must have an alias. I'll take some look tomorrow. Ah - I see it now in PKCS12KeyStore - it assigns

Re: RFR: 8225181: KeyStore should have a getAttributes method [v5]

2021-11-30 Thread Wei-Jun Wang
My understanding is that Java's PKCS12KeyStore will fabricate an alias string if there is no friendlyName, since every entry inside a KeyStore object must have an alias. I'll take some look tomorrow. Thanks, Max > On Nov 30, 2021, at 10:01 PM, Michael StJohns wrote: > > Hi - > >

Re: RFR: 8225181: KeyStore should have a getAttributes method [v5]

2021-11-30 Thread Michael StJohns
Hi - Generically, PKCS12 doesn't require an alias (friendlyName) for a particular Bag, but does permit it. Which means that getAttributes(String alias) could fail on a legal PKCS12.  It may be worthwhile to add a Set KeyStore::getAttributes(int bagNumber) method. Mike On 11/30/2021 8:15

Re: RFR: 8225181: KeyStore should have a getAttributes method [v5]

2021-11-30 Thread Weijun Wang
> 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 with a new target base due to a merge

Re: RFR: 8225181: KeyStore should have a getAttributes method [v4]

2021-11-30 Thread Weijun Wang
On Thu, 4 Nov 2021 19:34:50 GMT, Weijun Wang 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

Re: RFR: 8225181: KeyStore should have a getAttributes method [v3]

2021-11-04 Thread Weijun Wang
On Wed, 3 Nov 2021 14:18:38 GMT, Weijun Wang 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

Re: RFR: 8225181: KeyStore should have a getAttributes method [v4]

2021-11-04 Thread Weijun Wang
> 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

Re: RFR: 8225181: KeyStore should have a getAttributes method [v3]

2021-11-04 Thread Sean Mullan
On Thu, 4 Nov 2021 13:44:52 GMT, Weijun Wang wrote: >> src/java.base/share/classes/java/security/KeyStore.java line 1027: >> >>> 1025: * >>> 1026: * @implSpec >>> 1027: * The default implementation returns an empty {@code Set}. >> >> Would it make more sense for the default impl

Re: RFR: 8225181: KeyStore should have a getAttributes method [v3]

2021-11-04 Thread Weijun Wang
On Thu, 4 Nov 2021 13:21:19 GMT, Sean Mullan wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> more clear and precise spec > > src/java.base/share/classes/java/security/KeyStore.java line 1027: > >> 1025: * >>

Re: RFR: 8225181: KeyStore should have a getAttributes method [v3]

2021-11-04 Thread Sean Mullan
On Wed, 3 Nov 2021 14:18:38 GMT, Weijun Wang 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

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

2021-11-03 Thread Weijun Wang
On Tue, 2 Nov 2021 15:18:10 GMT, Sean Mullan wrote: >> 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:

Re: RFR: 8225181: KeyStore should have a getAttributes method [v3]

2021-11-03 Thread Weijun Wang
> 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

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

2021-11-02 Thread Sean Mullan
On Thu, 28 Oct 2021 16:58:47 GMT, Weijun Wang 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

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

2021-10-28 Thread Weijun Wang
On Thu, 28 Oct 2021 13:51:01 GMT, Sean Mullan wrote: >> I wonder if someone will interpret this as "after I've called `getEntry` on >> a private key, I can get the encrypted attributes through >> `KeyStore::getAttributes`". How about something like "and only available >> through the {@link

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

2021-10-28 Thread Weijun Wang
> 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

Re: RFR: 8225181: KeyStore should have a getAttributes method

2021-10-28 Thread Sean Mullan
On Wed, 27 Oct 2021 20:10:57 GMT, Weijun Wang wrote: >> Yes, a sentence like that would help. Some suggested tweaks: "For a >> PrivateKeyEntry or SecretKeyEntry, some attributes may be protected and not >> available unless the entry is first extracted by the getEntry() method." >> >> I don't

Re: RFR: 8225181: KeyStore should have a getAttributes method

2021-10-27 Thread Weijun Wang
On Wed, 27 Oct 2021 19:40:16 GMT, Sean Mullan wrote: >> This is complicated. Theoretically a KeyStore implementation can store some >> attributes in clear text and some encrypted, and it's probably not possible >> to know if there exist any encrypted ones before actually decrypting the >>

Re: RFR: 8225181: KeyStore should have a getAttributes method

2021-10-27 Thread Sean Mullan
On Tue, 26 Oct 2021 15:35:40 GMT, Weijun Wang wrote: >> src/java.base/share/classes/java/security/KeyStore.java line 1035: >> >>> 1033: * not extractable (For example, if the attributes is >>> encrypted >>> 1034: * in a private key entry or a secret key entry). >>> 1035:

Re: RFR: 8225181: KeyStore should have a getAttributes method

2021-10-27 Thread Sean Mullan
On Tue, 26 Oct 2021 15:42:02 GMT, Weijun Wang wrote: >> src/java.base/share/classes/java/security/KeyStoreSpi.java line 457: >> >>> 455: */ >>> 456: public Set engineGetAttributes(String alias) { >>> 457: return Collections.emptySet(); >> >> Would `Set.of()` be better here? >

Re: RFR: 8225181: KeyStore should have a getAttributes method

2021-10-26 Thread Weijun Wang
On Mon, 25 Oct 2021 14:36:58 GMT, Sean Mullan 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. > >

Re: RFR: 8225181: KeyStore should have a getAttributes method

2021-10-26 Thread Weijun Wang
On Mon, 25 Oct 2021 14:34:57 GMT, Sean Mullan 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. > >

Re: RFR: 8225181: KeyStore should have a getAttributes method

2021-10-25 Thread Sean Mullan
On Wed, 20 Oct 2021 02:08:24 GMT, Weijun Wang 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.

RFR: 8225181: KeyStore should have a getAttributes method

2021-10-19 Thread Weijun Wang
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. - Commit messages: - 8225181: KeyStore should have a getAttributes method