Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
03e2088
publish pem
ascarpino Jan 23, 2024
ceb233f
Merge branch 'master' into pem
ascarpino Jan 23, 2024
4b8bff1
cleanup of copyrights and other commented out code
ascarpino Jan 23, 2024
2f4e8cf
try MIMEEncoder again
ascarpino Jan 25, 2024
8fcc466
Decodes PKCS1
ascarpino Feb 24, 2024
659fbb4
Decodes PKCS1
ascarpino Feb 24, 2024
fca32e5
KeySpec
ascarpino Feb 26, 2024
faaea5b
cleanup, added @since, added KeyPair pub/private key decode (untested)
ascarpino Mar 8, 2024
25eb842
implement of()
ascarpino Mar 9, 2024
c5eb599
Add KeySpec check for KeyPair during decode.
ascarpino Mar 9, 2024
5670c9e
Remove default constructor
ascarpino Mar 9, 2024
10c2918
Update javadoc
ascarpino Apr 1, 2024
7bcab97
Update javadoc. Sealed SO.
ascarpino Apr 5, 2024
4f64a0e
Merge branch 'master' into pem
ascarpino Apr 9, 2024
b220432
clean up for this-escape lint change
ascarpino Apr 10, 2024
e76d310
Results of API discussion and cleanup
ascarpino Apr 18, 2024
a215874
Switch from EPS to P8EPS & X509EPS
ascarpino Apr 22, 2024
3f8881f
comment changes
ascarpino Apr 22, 2024
954ad9d
Merge branch 'master' into pem
ascarpino Apr 22, 2024
6f3fd2d
comment/exception updates
ascarpino Apr 24, 2024
24eed10
Doc changes
ascarpino May 1, 2024
05729e6
update
ascarpino May 9, 2024
e0a4c3c
Updating and review
ascarpino Jul 23, 2024
88b6a18
merge
ascarpino Jul 23, 2024
6b1b779
updates
ascarpino Jul 24, 2024
4f688a4
PEMRecord initial, tests pass
ascarpino Jul 25, 2024
9c7bc2b
internal PEMRecord optimization
ascarpino Jul 26, 2024
719ba35
bad test check
ascarpino Jul 26, 2024
49b7291
review comments and optimizations
ascarpino Aug 1, 2024
de154af
pemrecord whitespace
ascarpino Aug 1, 2024
ca53d3d
Merge branch 'pem' into pem-record
ascarpino Aug 3, 2024
e18785e
merge from pem branch
ascarpino Aug 3, 2024
ec608fd
Reorg tests data
ascarpino Aug 6, 2024
8146419
review comments part 2
ascarpino Aug 8, 2024
ec04656
test merge with futures
ascarpino Aug 9, 2024
c8dce84
Implement stream decoding
ascarpino Aug 14, 2024
1000786
fix StringBuffer/Builder
ascarpino Aug 14, 2024
cd53a0d
Merge branch 'master' into pem
ascarpino Aug 15, 2024
b7661a8
test fixes
ascarpino Aug 15, 2024
5812370
test fixes & cleanup
ascarpino Aug 16, 2024
804e73d
comments updates and getPBEID
ascarpino Sep 18, 2024
f1c1b11
fix decoding non-encrypted types
ascarpino Sep 25, 2024
6de472e
partial code review update
ascarpino Oct 16, 2024
cc2c482
Merge branch 'master' into pem
ascarpino Oct 16, 2024
4b3aae0
merge with master & updates
ascarpino Oct 17, 2024
f811452
apparently <p> can't be before a @implNote.. Who know.
ascarpino Oct 21, 2024
9e59cf1
code review comments
ascarpino Nov 3, 2024
23d89ba
Add SEC1-v2 for EC
ascarpino Nov 7, 2024
54e6f7f
Merge branch 'master' into pem
ascarpino Nov 7, 2024
56ec3e7
merge
ascarpino Nov 13, 2024
4c69d04
Merge branch 'master' into pem
ascarpino Nov 23, 2024
7a81824
Factory updates. SEC1v2 updates
ascarpino Nov 25, 2024
f1ae36c
Merge branch 'master' into pem-record
ascarpino Nov 25, 2024
97aa757
Merge branch 'pem-record' into pem-merge
ascarpino Nov 25, 2024
dfaff40
Merge in PEMRecord as part of the API.
ascarpino Dec 12, 2024
58e9402
merge
ascarpino Dec 12, 2024
34aed02
merge
ascarpino Dec 12, 2024
cc952c0
Merge branch 'pem-merge' into pem
ascarpino Dec 12, 2024
99294b7
Merge branch 'master' into pem
ascarpino Jan 7, 2025
cffec97
better comment and remove commented out code
ascarpino Mar 12, 2025
106788e
merge with master
ascarpino Mar 13, 2025
74fca1c
code review comments
ascarpino Mar 25, 2025
0db8fdb
javadoc updates
ascarpino Apr 17, 2025
d8f1b5e
Merge branch 'master' into pem
ascarpino Apr 17, 2025
889c054
Merge branch 'master' into pem
ascarpino May 1, 2025
0c54032
major code review comments update
ascarpino May 2, 2025
6928032
non-sealed
ascarpino May 3, 2025
5d1f4a5
toString update
ascarpino May 8, 2025
ae43835
comments
ascarpino May 8, 2025
2c7f241
comments on the 11th
ascarpino May 11, 2025
727e996
comments on the 11th
ascarpino May 13, 2025
0eef660
comments
ascarpino May 13, 2025
2d83925
comments
ascarpino May 14, 2025
78d5bf6
comments
ascarpino May 15, 2025
572841f
Merge branch 'master' into pem
ascarpino May 15, 2025
8bf36d6
merge in JEP 513
ascarpino May 15, 2025
80139d4
fix EKS error after JEP 513
ascarpino May 15, 2025
7402183
comments
ascarpino May 16, 2025
397d0cb
comments
ascarpino May 16, 2025
f05de12
comments
ascarpino May 16, 2025
8a07c3c
test updates
ascarpino May 23, 2025
fdeaa93
PEM reading tweak
ascarpino May 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/java.base/share/classes/java/security/AsymmetricKey.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -34,7 +34,7 @@
*
* @since 22
*/
public interface AsymmetricKey extends Key {
public non-sealed interface AsymmetricKey extends Key, DEREncodable {
/**
* Returns the parameters associated with this key.
* The parameters are optional and may be either
Expand Down
59 changes: 59 additions & 0 deletions src/java.base/share/classes/java/security/DEREncodable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/

package java.security;

import jdk.internal.javac.PreviewFeature;

import javax.crypto.EncryptedPrivateKeyInfo;
import java.security.cert.X509CRL;
import java.security.cert.X509Certificate;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;

/**
* This interface is implemented by security API classes that contain
* binary-encodable key or certificate material.
* These APIs or their subclasses typically provide methods to convert
* their instances to and from byte arrays in the Distinguished
* Encoding Rules (DER) format.
*
* @see AsymmetricKey
* @see KeyPair
* @see PKCS8EncodedKeySpec
* @see X509EncodedKeySpec
* @see EncryptedPrivateKeyInfo
* @see X509Certificate
* @see X509CRL
* @see PEMRecord
*
* @since 25
*/

@PreviewFeature(feature = PreviewFeature.Feature.PEM_API)
public sealed interface DEREncodable permits AsymmetricKey, KeyPair,
PKCS8EncodedKeySpec, X509EncodedKeySpec, EncryptedPrivateKeyInfo,
X509Certificate, X509CRL, PEMRecord {
}
2 changes: 1 addition & 1 deletion src/java.base/share/classes/java/security/KeyPair.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @since 1.1
*/

public final class KeyPair implements java.io.Serializable {
public final class KeyPair implements java.io.Serializable, DEREncodable {

@java.io.Serial
private static final long serialVersionUID = -7565189502268009837L;
Expand Down
Loading