Re: RFR: 8298420: PEM API: Implementation (Preview) [v23]

2025-05-23 Thread Anthony Scarpino
> Hi all, > > I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a format > for encoding and decoding cryptographic keys and certificates. It will be > integrated into JDK24 as a Preview Feature. Preview features does not > permanently define the API and it is subject to cha

Re: RFR: 8298420: PEM API: Implementation (Preview) [v22]

2025-05-16 Thread Anthony Scarpino
> Hi all, > > I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a format > for encoding and decoding cryptographic keys and certificates. It will be > integrated into JDK24 as a Preview Feature. Preview features does not > permanently define the API and it is subject to cha

Re: RFR: 8298420: PEM API: Implementation (Preview) [v21]

2025-05-15 Thread Weijun Wang
On Thu, 15 May 2025 03:37:57 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview featur

Re: RFR: 8298420: PEM API: Implementation (Preview) [v21]

2025-05-14 Thread Anthony Scarpino
> Hi all, > > I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a format > for encoding and decoding cryptographic keys and certificates. It will be > integrated into JDK24 as a Preview Feature. Preview features does not > permanently define the API and it is subject to cha

Re: RFR: 8298420: PEM API: Implementation (Preview) [v20]

2025-05-14 Thread Anthony Scarpino
On Wed, 14 May 2025 11:38:15 GMT, Weijun Wang wrote: >> src/java.base/share/classes/java/security/PEMRecord.java line 119: >> >>> 117: >>> 118: * @param type the PEM type identifier >>> 119: * @param pem the Base64-encoded data encapsulated by the PEM >>> header and >> >> Since inte

Re: RFR: 8298420: PEM API: Implementation (Preview) [v17]

2025-05-14 Thread Anthony Scarpino
On Mon, 12 May 2025 20:36:40 GMT, Sean Mullan wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> comments on the 11th > > src/java.base/share/classes/java/security/PEMRecord.java line 129: > >> 127: * >> 128

Re: RFR: 8298420: PEM API: Implementation (Preview) [v14]

2025-05-14 Thread Anthony Scarpino
On Sun, 27 Apr 2025 19:10:31 GMT, Anthony Scarpino wrote: >> src/java.base/share/classes/java/security/PEMDecoder.java line 213: >> >>> 211: Objects.requireNonNull(str); >>> 212: try { >>> 213: return decode(new ByteArrayInputStream(str.getBytes())); >> >> `str.getB

Re: RFR: 8298420: PEM API: Implementation (Preview) [v17]

2025-05-14 Thread Anthony Scarpino
On Mon, 12 May 2025 18:49:56 GMT, Weijun Wang wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> comments on the 11th > > src/java.base/share/classes/java/security/PEMRecord.java line 101: > >> 99: // inc

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-14 Thread Anthony Scarpino
On Mon, 5 May 2025 13:12:11 GMT, Sean Mullan wrote: >> Anthony Scarpino has updated the pull request with a new target base due to >> a merge or a rebase. The pull request now contains 66 commits: >> >> - major code review comments update >> - Merge branch 'master' into pem >> - Merge branch

Re: RFR: 8298420: PEM API: Implementation (Preview) [v18]

2025-05-14 Thread Anthony Scarpino
On Tue, 13 May 2025 21:46:26 GMT, Sean Mullan wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> comments on the 11th > > src/java.base/share/classes/java/security/PEMRecord.java line 48: > >> 46: * >> 47: * D

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-14 Thread Anthony Scarpino
On Thu, 8 May 2025 21:32:13 GMT, Weijun Wang wrote: >> There is an inconsistency with PEMRecord here. These methods should not >> allow leadingData if it is not available elsewhere. I will redo that. >> leadingData can be reserved for the decode methods that take a class. >> >> I tried not

Re: RFR: 8298420: PEM API: Implementation (Preview) [v20]

2025-05-14 Thread Anthony Scarpino
On Wed, 14 May 2025 13:16:17 GMT, Weijun Wang wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> comments > > src/java.base/share/classes/java/security/PEMDecoder.java line 61: > >> 59: * >> 60: * >> 61: * >I

Re: RFR: 8298420: PEM API: Implementation (Preview) [v20]

2025-05-14 Thread Anthony Scarpino
On Wed, 14 May 2025 15:52:34 GMT, Sean Mullan wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> comments > > src/java.base/share/classes/java/security/DEREncodable.java line 41: > >> 39: * These APIs or their s

Re: RFR: 8298420: PEM API: Implementation (Preview) [v20]

2025-05-14 Thread Sean Mullan
On Wed, 14 May 2025 08:25:41 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview featur

Re: RFR: 8298420: PEM API: Implementation (Preview) [v20]

2025-05-14 Thread Weijun Wang
On Wed, 14 May 2025 08:25:41 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview featur

Re: RFR: 8298420: PEM API: Implementation (Preview) [v20]

2025-05-14 Thread Sean Mullan
On Wed, 14 May 2025 08:25:41 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview featur

Re: RFR: 8298420: PEM API: Implementation (Preview) [v20]

2025-05-14 Thread Weijun Wang
On Wed, 14 May 2025 08:25:41 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview featur

Re: RFR: 8298420: PEM API: Implementation (Preview) [v20]

2025-05-14 Thread Weijun Wang
On Wed, 14 May 2025 08:25:41 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview featur

Re: RFR: 8298420: PEM API: Implementation (Preview) [v20]

2025-05-14 Thread Weijun Wang
On Wed, 14 May 2025 11:36:46 GMT, Weijun Wang wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> comments > > src/java.base/share/classes/java/security/PEMRecord.java line 119: > >> 117: >> 118: * @param ty

Re: RFR: 8298420: PEM API: Implementation (Preview) [v20]

2025-05-14 Thread Weijun Wang
On Wed, 14 May 2025 08:25:41 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview featur

Re: RFR: 8298420: PEM API: Implementation (Preview) [v20]

2025-05-14 Thread Weijun Wang
On Wed, 14 May 2025 08:25:41 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview featur

Re: RFR: 8298420: PEM API: Implementation (Preview) [v19]

2025-05-14 Thread Anthony Scarpino
On Tue, 13 May 2025 22:13:13 GMT, Weijun Wang wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> comments > > src/java.base/share/classes/java/security/PEMDecoder.java line 61: > >> 59: * >> 60: * >> 61: * I

Re: RFR: 8298420: PEM API: Implementation (Preview) [v17]

2025-05-14 Thread Anthony Scarpino
On Tue, 13 May 2025 02:21:16 GMT, Anthony Scarpino wrote: >> src/java.base/share/classes/java/security/PEMEncoder.java line 95: >> >>> 93: * RFC 1421: Privacy Enhancement for Internet Electronic Mail >>> 94: * @spec https://www.rfc-editor.org/info/rfc5958 >>> 95: * RFC 5958: Asym

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-14 Thread Anthony Scarpino
On Tue, 6 May 2025 20:49:10 GMT, Weijun Wang wrote: >> Anthony Scarpino has updated the pull request with a new target base due to >> a merge or a rebase. The pull request now contains 66 commits: >> >> - major code review comments update >> - Merge branch 'master' into pem >> - Merge branch

Re: RFR: 8298420: PEM API: Implementation (Preview) [v18]

2025-05-14 Thread Anthony Scarpino
On Tue, 13 May 2025 22:28:48 GMT, Weijun Wang wrote: >> src/java.base/share/classes/java/security/PEMDecoder.java line 464: >> >>> 462: * >>> 463: * If {@code provider} is {@code null}, a new instance is >>> returned with >>> 464: * the default provider configuration. >> >> IMHO

Re: RFR: 8298420: PEM API: Implementation (Preview) [v17]

2025-05-14 Thread Anthony Scarpino
On Mon, 12 May 2025 14:35:45 GMT, Sean Mullan wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> comments on the 11th > > src/java.base/share/conf/security/java.security line 1560: > >> 1558: # withEncryption met

Re: RFR: 8298420: PEM API: Implementation (Preview) [v17]

2025-05-14 Thread Anthony Scarpino
On Tue, 13 May 2025 07:37:06 GMT, Krushna948 wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> comments on the 11th > > src/java.base/share/classes/javax/crypto/EncryptedPrivateKeyInfo.java line > 369: > >> 367

Re: RFR: 8298420: PEM API: Implementation (Preview) [v18]

2025-05-14 Thread Anthony Scarpino
On Tue, 13 May 2025 17:15:39 GMT, Sean Mullan wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> comments on the 11th > > src/java.base/share/classes/java/security/DEREncodable.java line 37: > >> 35: >> 36: /**

Re: RFR: 8298420: PEM API: Implementation (Preview) [v20]

2025-05-14 Thread Anthony Scarpino
> Hi all, > > I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a format > for encoding and decoding cryptographic keys and certificates. It will be > integrated into JDK24 as a Preview Feature. Preview features does not > permanently define the API and it is subject to cha

Re: RFR: 8298420: PEM API: Implementation (Preview) [v18]

2025-05-13 Thread Weijun Wang
On Tue, 13 May 2025 19:46:27 GMT, Sean Mullan wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> comments on the 11th > > src/java.base/share/classes/java/security/PEMDecoder.java line 464: > >> 462: * >> 46

Re: RFR: 8298420: PEM API: Implementation (Preview) [v19]

2025-05-13 Thread Weijun Wang
On Tue, 13 May 2025 21:45:32 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview featur

Re: RFR: 8298420: PEM API: Implementation (Preview) [v17]

2025-05-13 Thread Weijun Wang
On Sun, 11 May 2025 19:02:55 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview featur

Re: RFR: 8298420: PEM API: Implementation (Preview) [v19]

2025-05-13 Thread Weijun Wang
On Tue, 13 May 2025 21:45:32 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview featur

Re: RFR: 8298420: PEM API: Implementation (Preview) [v18]

2025-05-13 Thread Sean Mullan
On Tue, 13 May 2025 09:27:37 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview featur

Re: RFR: 8298420: PEM API: Implementation (Preview) [v19]

2025-05-13 Thread Anthony Scarpino
> Hi all, > > I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a format > for encoding and decoding cryptographic keys and certificates. It will be > integrated into JDK24 as a Preview Feature. Preview features does not > permanently define the API and it is subject to cha

Re: RFR: 8298420: PEM API: Implementation (Preview) [v18]

2025-05-13 Thread Sean Mullan
On Tue, 13 May 2025 09:27:37 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview featur

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-13 Thread Sean Mullan
On Fri, 9 May 2025 16:24:39 GMT, Anthony Scarpino wrote: >> src/java.base/share/classes/java/security/PEMEncoder.java line 216: >> >>> 214: /** >>> 215: * Returns a new immutable PEMEncoder instance configured to the >>> default >>> 216: * encryption algorithm and a given password

Re: RFR: 8298420: PEM API: Implementation (Preview) [v18]

2025-05-13 Thread Sean Mullan
On Tue, 13 May 2025 09:27:37 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview featur

Re: RFR: 8298420: PEM API: Implementation (Preview) [v17]

2025-05-13 Thread Sean Mullan
On Tue, 13 May 2025 02:21:57 GMT, Anthony Scarpino wrote: >> src/java.base/share/classes/java/security/PEMEncoder.java line 129: >> >>> 127: * Returns a new instance of {@code PEMEncoder}. >>> 128: * >>> 129: * @return new {@code PEMEncoder} instance >> >> "new" sounds like it i

Re: RFR: 8298420: PEM API: Implementation (Preview) [v18]

2025-05-13 Thread Sean Mullan
On Tue, 13 May 2025 09:27:37 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview featur

Re: RFR: 8298420: PEM API: Implementation (Preview) [v18]

2025-05-13 Thread Sean Mullan
On Tue, 13 May 2025 09:27:37 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview featur

Re: RFR: 8298420: PEM API: Implementation (Preview) [v17]

2025-05-13 Thread Krushna948
On Sun, 11 May 2025 19:02:55 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview featur

Re: RFR: 8298420: PEM API: Implementation (Preview) [v17]

2025-05-13 Thread Sean Mullan
On Tue, 13 May 2025 09:20:07 GMT, Anthony Scarpino wrote: >> src/java.base/share/classes/sun/security/x509/X509Key.java line 147: >> >>> 145: * X509Key. Useful for PKCS8v2. >>> 146: */ >>> 147: public static X509Key parse(byte[] encoded) throws IOException >> >> Isn't this the s

Re: RFR: 8298420: PEM API: Implementation (Preview) [v18]

2025-05-13 Thread Sean Mullan
On Wed, 7 May 2025 16:34:24 GMT, Sean Mullan wrote: >> I added the exception > > `SecretKeyFactory.getInstance()` will throw `NullPointerException` if the > property is undefined. You would need to add a try/catch block for NPE > specifically, which you don't have right now. This is still an i

Re: RFR: 8298420: PEM API: Implementation (Preview) [v16]

2025-05-13 Thread Sean Mullan
On Sat, 10 May 2025 19:39:14 GMT, Anthony Scarpino wrote: >> src/java.base/share/classes/java/security/PEMDecoder.java line 191: >> >>> 189: } >>> 190: case Pem.CERTIFICATE, Pem.X509_CERTIFICATE -> { >>> 191: CertificateFactory cf = getCertFac

Re: RFR: 8298420: PEM API: Implementation (Preview) [v16]

2025-05-13 Thread Anthony Scarpino
On Fri, 9 May 2025 23:46:27 GMT, Weijun Wang wrote: >> Anthony Scarpino has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - comments >> - toString update >> - non-sealed >>Better X509 KeyPair parsing > > src/java.base/share/classes

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-13 Thread Anthony Scarpino
On Mon, 12 May 2025 22:03:47 GMT, Sean Mullan wrote: >> I would probably just say "cryptographic objects that implement >> `DEREncodable`" > > Also change "may" to "can". "May" sounds like it is optional. ok - PR Review Comment: https://git.openjdk.org/jdk/pull/17543#discussion_r2

Re: RFR: 8298420: PEM API: Implementation (Preview) [v17]

2025-05-13 Thread Anthony Scarpino
On Mon, 12 May 2025 22:09:14 GMT, Sean Mullan wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> comments on the 11th > > src/java.base/share/classes/java/security/PEMEncoder.java line 61: > >> 59: * or by encod

Re: RFR: 8298420: PEM API: Implementation (Preview) [v14]

2025-05-13 Thread Anthony Scarpino
On Mon, 12 May 2025 19:19:32 GMT, Sean Mullan wrote: >> I'm assuming there is no more issues here. > > There is still a small issue. On line 228, a clone of the array is now being > done when it doesn't have to. The previous code called the internal > `getArrayS0` method which did not do a clon

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-13 Thread Anthony Scarpino
On Mon, 12 May 2025 22:20:23 GMT, Sean Mullan wrote: >> I think specifying the fields that are encoded makes it clear what is not in >> the encoding. > > I would have expected the leading data to be encoded. Why is the leading data > not encoded? Ok. I added a comment to explicitly say no. I

Re: RFR: 8298420: PEM API: Implementation (Preview) [v18]

2025-05-13 Thread Anthony Scarpino
> Hi all, > > I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a format > for encoding and decoding cryptographic keys and certificates. It will be > integrated into JDK24 as a Preview Feature. Preview features does not > permanently define the API and it is subject to cha

Re: RFR: 8298420: PEM API: Implementation (Preview) [v16]

2025-05-13 Thread Anthony Scarpino
On Fri, 9 May 2025 15:13:18 GMT, Sean Mullan wrote: >> Anthony Scarpino has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - comments >> - toString update >> - non-sealed >>Better X509 KeyPair parsing > > src/java.base/share/classes

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-12 Thread Sean Mullan
On Thu, 8 May 2025 20:58:41 GMT, Anthony Scarpino wrote: >> src/java.base/share/classes/java/security/PEMEncoder.java line 54: >> >>> 52: * and footer. >>> 53: * >>> 54: * Encoding may be performed on Java Cryptographic Extension (JCE) >>> objects >> >> Is "JCE objects" a formal term? We u

Re: RFR: 8298420: PEM API: Implementation (Preview) [v17]

2025-05-12 Thread Sean Mullan
On Sun, 11 May 2025 19:02:55 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview featur

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-12 Thread Sean Mullan
On Mon, 12 May 2025 21:55:46 GMT, Sean Mullan wrote: >> I'd like to keep the JCA/JCE nuance out. I'd rather just leave it as is, or >> use the alternative I've used elsewhere, Java API cryptographic object. > > I would probably just say "cryptographic objects that implement > `DEREncodable`"

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-12 Thread Sean Mullan
On Sat, 10 May 2025 01:24:28 GMT, Anthony Scarpino wrote: >> src/java.base/share/classes/sun/security/pkcs/PKCS8Key.java line 79: >> >>> 77: >>> 78: /* PKCS8 version of the PEM */ >>> 79: protected int version; >> >> Do these need to be protected? It doesn't seem like any subclasses n

Re: RFR: 8298420: PEM API: Implementation (Preview) [v17]

2025-05-12 Thread Sean Mullan
On Sun, 11 May 2025 19:02:55 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview featur

Re: RFR: 8298420: PEM API: Implementation (Preview) [v14]

2025-05-12 Thread Sean Mullan
On Sat, 10 May 2025 01:19:06 GMT, Anthony Scarpino wrote: >> It was previously called by `calculatePublicKey` - I think those bytes are >> never exposed externally, so safe to not clone. > > I'm assuming there is no more issues here. There is still a small issue. On line 228, a clone of the ar

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-12 Thread Sean Mullan
On Fri, 9 May 2025 22:08:00 GMT, Anthony Scarpino wrote: >> src/java.base/share/classes/java/security/spec/PKCS8EncodedKeySpec.java line >> 41: >> >>> 39: * privateKeyAlgorithm PrivateKeyAlgorithmIdentifier, >>> 40: * privateKey PrivateKey, >>> 41: * attributes [0] IMPLICIT Attri

Re: RFR: 8298420: PEM API: Implementation (Preview) [v17]

2025-05-12 Thread Sean Mullan
On Sun, 11 May 2025 19:02:55 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview featur

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-12 Thread Sean Mullan
On Fri, 9 May 2025 20:46:49 GMT, Anthony Scarpino wrote: >> src/java.base/share/classes/java/security/spec/EncodedKeySpec.java line 63: >> >>> 61: * This constructor extracts the algorithm name from the encoded >>> bytes, >>> 62: * which may be an OID if no standard algorithm name is

Re: RFR: 8298420: PEM API: Implementation (Preview) [v16]

2025-05-12 Thread Sean Mullan
On Thu, 8 May 2025 20:40:28 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview features

Re: RFR: 8298420: PEM API: Implementation (Preview) [v16]

2025-05-11 Thread Anthony Scarpino
On Fri, 9 May 2025 18:06:10 GMT, Weijun Wang wrote: >> Anthony Scarpino has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - comments >> - toString update >> - non-sealed >>Better X509 KeyPair parsing > > src/java.base/share/classes

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-11 Thread Anthony Scarpino
On Thu, 8 May 2025 16:12:07 GMT, Weijun Wang wrote: >> Anthony Scarpino has updated the pull request with a new target base due to >> a merge or a rebase. The pull request now contains 66 commits: >> >> - major code review comments update >> - Merge branch 'master' into pem >> - Merge branch

Re: RFR: 8298420: PEM API: Implementation (Preview) [v16]

2025-05-11 Thread Anthony Scarpino
On Fri, 9 May 2025 15:13:29 GMT, Sean Mullan wrote: >> Anthony Scarpino has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - comments >> - toString update >> - non-sealed >>Better X509 KeyPair parsing > > src/java.base/share/classes

Re: RFR: 8298420: PEM API: Implementation (Preview) [v17]

2025-05-11 Thread Anthony Scarpino
On Fri, 9 May 2025 17:57:30 GMT, Weijun Wang wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> comments on the 11th > > src/java.base/share/classes/java/security/PEMRecord.java line 87: > >> 85: */ >> 86:

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-11 Thread Anthony Scarpino
On Fri, 9 May 2025 15:26:42 GMT, Sean Mullan wrote: >> I split them and reworded it, HTH. > > What I was suggesting was to have an additional sentence first describing > what each of these methods is for. I'll suggest something later. ok - PR Review Comment: https://git.openjdk.or

Re: RFR: 8298420: PEM API: Implementation (Preview) [v17]

2025-05-11 Thread Anthony Scarpino
> Hi all, > > I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a format > for encoding and decoding cryptographic keys and certificates. It will be > integrated into JDK24 as a Preview Feature. Preview features does not > permanently define the API and it is subject to cha

Re: RFR: 8298420: PEM API: Implementation (Preview) [v14]

2025-05-09 Thread Anthony Scarpino
On Mon, 28 Apr 2025 16:23:44 GMT, Weijun Wang wrote: >> This is catching any errors that may occur that may not a result of the >> Provider. ProviderException is for errors/problems with the Provider. > > The `SecurityException` class currently says: > > * This exception was originally speci

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-09 Thread Anthony Scarpino
On Tue, 6 May 2025 20:56:32 GMT, Weijun Wang wrote: >> Anthony Scarpino has updated the pull request with a new target base due to >> a merge or a rebase. The pull request now contains 66 commits: >> >> - major code review comments update >> - Merge branch 'master' into pem >> - Merge branch

Re: RFR: 8298420: PEM API: Implementation (Preview) [v14]

2025-05-09 Thread Anthony Scarpino
On Fri, 2 May 2025 17:50:22 GMT, Sean Mullan wrote: >> `getArrayS0` does not clone. It's only safe to use it internally. > > It was previously called by `calculatePublicKey` - I think those bytes are > never exposed externally, so safe to not clone. I'm assuming there is no more issues here. -

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-09 Thread Anthony Scarpino
On Tue, 6 May 2025 21:19:04 GMT, Weijun Wang wrote: >> src/java.base/share/classes/java/security/PEMEncoder.java line 218: >> >>> 216: * encryption algorithm and a given password. >>> 217: * >>> 218: * Only {@link PrivateKey} will be encrypted with this newly >>> configured >>

Re: RFR: 8298420: PEM API: Implementation (Preview) [v14]

2025-05-09 Thread Anthony Scarpino
On Thu, 1 May 2025 17:47:03 GMT, Weijun Wang wrote: >> I see your point now, but `leadingData` is a byte array. If an app wrote >> the `leadingData` in a `ByteArrayInputStream`, followed by the PEM text, it >> would not be the same data written as the newline would be gone. Correct? > > Why w

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-09 Thread Anthony Scarpino
On Mon, 5 May 2025 14:30:12 GMT, Sean Mullan wrote: >> Anthony Scarpino has updated the pull request with a new target base due to >> a merge or a rebase. The pull request now contains 66 commits: >> >> - major code review comments update >> - Merge branch 'master' into pem >> - Merge branch

Re: RFR: 8298420: PEM API: Implementation (Preview) [v14]

2025-05-09 Thread Anthony Scarpino
On Thu, 8 May 2025 13:41:10 GMT, Sean Mullan wrote: >> I didn't change the rest of them because I didn't want to make too many >> unnecessary edits. I understand you like it, but it is not a concise >> description. >> >> The one word "cloned" is a lot simpler and means the same as: >> "The c

Re: RFR: 8298420: PEM API: Implementation (Preview) [v16]

2025-05-09 Thread Weijun Wang
On Thu, 8 May 2025 20:40:28 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview features

Re: RFR: 8298420: PEM API: Implementation (Preview) [v16]

2025-05-09 Thread Weijun Wang
On Thu, 8 May 2025 20:40:28 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview features

Re: RFR: 8298420: PEM API: Implementation (Preview) [v16]

2025-05-09 Thread Sean Mullan
On Thu, 8 May 2025 20:40:28 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview features

Re: RFR: 8298420: PEM API: Implementation (Preview) [v16]

2025-05-09 Thread Weijun Wang
On Thu, 8 May 2025 20:40:28 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview features

Re: RFR: 8298420: PEM API: Implementation (Preview) [v16]

2025-05-09 Thread Weijun Wang
On Thu, 8 May 2025 20:40:28 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview features

Re: RFR: 8298420: PEM API: Implementation (Preview) [v16]

2025-05-09 Thread Weijun Wang
On Thu, 8 May 2025 20:40:28 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview features

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-09 Thread Sean Mullan
On Thu, 8 May 2025 04:09:02 GMT, Anthony Scarpino wrote: >> src/java.base/share/classes/java/security/PEMDecoder.java line 71: >> >>> 69: * with {@linkplain #withFactory} and/or {@linkplain #withDecryption}. >>> 70: * Configuring an instance for decryption does not prevent decoding with >>> 71

Re: RFR: 8298420: PEM API: Implementation (Preview) [v16]

2025-05-09 Thread Sean Mullan
On Thu, 8 May 2025 20:40:28 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview features

Re: RFR: 8298420: PEM API: Implementation (Preview) [v16]

2025-05-09 Thread Sean Mullan
On Thu, 8 May 2025 20:40:28 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview features

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-08 Thread Weijun Wang
On Thu, 8 May 2025 04:46:31 GMT, Anthony Scarpino wrote: >> src/java.base/share/classes/java/security/PEMDecoder.java line 228: >> >>> 226: * This method will read the {@code InputStream} until PEM data >>> is >>> 227: * found or until the end of the stream. Non-PEM data in the >>> 2

Re: RFR: 8298420: PEM API: Implementation (Preview) [v16]

2025-05-08 Thread Weijun Wang
On Thu, 8 May 2025 20:40:28 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview features

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-08 Thread Anthony Scarpino
On Tue, 6 May 2025 20:52:14 GMT, Weijun Wang wrote: >> Anthony Scarpino has updated the pull request with a new target base due to >> a merge or a rebase. The pull request now contains 66 commits: >> >> - major code review comments update >> - Merge branch 'master' into pem >> - Merge branch

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-08 Thread Anthony Scarpino
On Wed, 7 May 2025 19:02:47 GMT, Sean Mullan wrote: >> src/java.base/share/classes/java/security/PEMDecoder.java line 118: >> >>> 116: /** >>> 117: * Returns an instance of {@code PEMDecoder}. This instance may >>> be repeatedly used >>> 118: * to decode different PEM text. >> >

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-08 Thread Anthony Scarpino
On Wed, 7 May 2025 18:38:31 GMT, Sean Mullan wrote: >> Anthony Scarpino has updated the pull request with a new target base due to >> a merge or a rebase. The pull request now contains 66 commits: >> >> - major code review comments update >> - Merge branch 'master' into pem >> - Merge branch

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-08 Thread Anthony Scarpino
On Wed, 7 May 2025 16:37:00 GMT, Weijun Wang wrote: >> Anthony Scarpino has updated the pull request with a new target base due to >> a merge or a rebase. The pull request now contains 66 commits: >> >> - major code review comments update >> - Merge branch 'master' into pem >> - Merge branch

Re: RFR: 8298420: PEM API: Implementation (Preview) [v16]

2025-05-08 Thread Anthony Scarpino
> Hi all, > > I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a format > for encoding and decoding cryptographic keys and certificates. It will be > integrated into JDK24 as a Preview Feature. Preview features does not > permanently define the API and it is subject to cha

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-08 Thread Weijun Wang
On Fri, 2 May 2025 06:09:52 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview features

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-08 Thread Sean Mullan
On Fri, 2 May 2025 06:09:52 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview features

Re: RFR: 8298420: PEM API: Implementation (Preview) [v14]

2025-05-08 Thread Sean Mullan
On Sat, 26 Apr 2025 08:39:50 GMT, Anthony Scarpino wrote: >> src/java.base/share/classes/javax/crypto/EncryptedPrivateKeyInfo.java line >> 83: >> >>> 81: * Constructs an {@code EncryptedPrivateKeyInfo} from a given >>> Encrypted >>> 82: * PKCS#8 ASN.1 encoding. >>> 83: * @param

Re: RFR: 8298420: PEM API: Implementation (Preview) [v9]

2025-05-08 Thread Sean Mullan
On Thu, 31 Oct 2024 01:44:32 GMT, Weijun Wang wrote: >> I'm not sure if it was exclusively a Security Manager exception, but >> @seanjmullan had said previously that `SecurityException` was used elsewhere. > > It was used when `JarInputStream::read` encountered a wrong hash or > signature. But,

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-07 Thread Sean Mullan
On Wed, 7 May 2025 16:42:20 GMT, Weijun Wang wrote: >> Anthony Scarpino has updated the pull request with a new target base due to >> a merge or a rebase. The pull request now contains 66 commits: >> >> - major code review comments update >> - Merge branch 'master' into pem >> - Merge branch

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-07 Thread Sean Mullan
On Fri, 2 May 2025 06:09:52 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview features

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-07 Thread Sean Mullan
On Fri, 2 May 2025 06:09:52 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview features

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-07 Thread Sean Mullan
On Tue, 30 Jul 2024 21:06:06 GMT, Anthony Scarpino wrote: >> I'm afraid that someone will overwrite the java.security file and remove >> that property. Then wonder what will happen and if the error message is >> clear. > > I added the exception `SecretKeyFactory.getInstance()` will throw `Nul

Re: RFR: 8298420: PEM API: Implementation (Preview) [v15]

2025-05-07 Thread Weijun Wang
On Fri, 2 May 2025 06:09:52 GMT, Anthony Scarpino wrote: >> Hi all, >> >> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a >> format for encoding and decoding cryptographic keys and certificates. It >> will be integrated into JDK24 as a Preview Feature. Preview features

  1   2   3   >