Skip to content

Commit

Permalink
Merge branch '1792-1770-1747-1746-pgp-documentation' into 'main'
Browse files Browse the repository at this point in the history
Deprecate RevocationKey signature subpacket.

See merge request root/bc-java!28
  • Loading branch information
dghgit committed Sep 11, 2024
2 parents c798e66 + 571954f commit a8380ae
Show file tree
Hide file tree
Showing 66 changed files with 768 additions and 161 deletions.
2 changes: 1 addition & 1 deletion pg/src/main/j2me/org/bouncycastle/bcpg/S2K.java
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ public Argon2Params(byte[] salt, int passes, int parallelism, int memSizeExp)

// log_2(p) = log_e(p) / log_e(2)
//double log2_p = Math.log((double)parallelism) / Math.log(2.0);
// see https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-05.html#section-3.7.1.4-5
// see https://www.rfc-editor.org/rfc/rfc9580.html#section-3.7.1.4-5
//if (memSizeExp < (3 + Math.ceil(log2_p)) || memSizeExp > 31)
//{
//throw new IllegalArgumentException("Memory size exponent MUST be between 3+ceil(log_2(parallelism)) and 31");
Expand Down
10 changes: 5 additions & 5 deletions pg/src/main/java/org/bouncycastle/bcpg/AEADAlgorithmTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

/**
* AEAD Algorithm IDs.
* Crypto-Refresh (OpenPGP) defines IDs 1 through 3, while LibrePGP only defines 1 and 2.
* Further, the use of AEAD differs between C-R and LibrePGP.
* RFC9580 (OpenPGP) defines IDs 1 through 3, while LibrePGP only defines 1 and 2.
* Further, the use of AEAD differs between OpenPGP and LibrePGP.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-aead-algorithms">
* Crypto-Refresh: AEAD Algorithms</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-aead-algorithms">
* OpenPGP - AEAD Algorithms</a>
* @see <a href="https://www.ietf.org/archive/id/draft-koch-librepgp-00.html#name-encryption-modes">
* LibrePGP - Encryption Modes</a>
*/
Expand All @@ -18,7 +18,7 @@ public interface AEADAlgorithmTags
int EAX = 1;
/**
* OCB with 15-bit nonce/IV and 16-bit auth tag length.
* C-R compliant implementations MUST implement OCB.
* RFC9580-compliant implementations MUST implement OCB.
*/
int OCB = 2;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* @see <a href="https://www.rfc-editor.org/rfc/rfc4880.html#section-9.3">
* RFC4880 - Compression Algorithms</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-compression-algorithms">
* RFC9580 - Compression Algorithms</a>
* @see <a href="https://www.ietf.org/archive/id/draft-koch-librepgp-00.html#name-compression-algorithms">
* LibrePGP - Compression Algorithms</a>
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-compression-algorithms">
* Crypto-Refresh - Compression Algorithms</a>
*/
public interface CompressionAlgorithmTags
{
Expand Down
4 changes: 2 additions & 2 deletions pg/src/main/java/org/bouncycastle/bcpg/ECDHPublicBCPGKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* If you want to be compatible with legacy applications however, you should use this class instead.
* Note though, that for v6 keys, {@link X25519PublicBCPGKey} or {@link X448PublicBCPGKey} MUST be used for X25519, X448.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-algorithm-specific-part-for-ecd">
* Crypto-Refresh - Algorithm-Specific Parts for ECDH Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-algorithm-specific-part-for-ecd">
* OpenPGP - Algorithm-Specific Parts for ECDH Keys</a>
*/
public class ECDHPublicBCPGKey
extends ECPublicBCPGKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* Base class for an ECDSA Public Key.
* This type is used with {@link PublicKeyAlgorithmTags#ECDSA} and the curve is identified by providing an OID.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-algorithm-specific-part-for-ec">
* Crypto-Refresh - Algorithm-Specific Parts for ECDSA Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-algorithm-specific-part-for-ec">
* OpenPGP - Algorithm-Specific Parts for ECDSA Keys</a>
*/
public class ECDSAPublicBCPGKey
extends ECPublicBCPGKey
Expand Down
12 changes: 6 additions & 6 deletions pg/src/main/java/org/bouncycastle/bcpg/ECSecretBCPGKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
* If you want to be compatible with legacy applications however, you should use this class instead.
* Note though, that for v6 keys, {@link X25519SecretBCPGKey} or {@link X448SecretBCPGKey} MUST be used for X25519, X448.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-algorithm-specific-part-for-ecd">
* Crypto-Refresh - Algorithm-Specific Parts for ECDH Keys</a>
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-algorithm-specific-part-for-ec">
* Crypto-Refresh - Algorithm-Specific Parts for ECDSA Keys</a>
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-curve25519legacy-ecdh-secre">
* Crypto-Refresh - Curve25519Legacy ECDH Secret Key Material (deprecated)</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-algorithm-specific-part-for-ecd">
* OpenPGP - Algorithm-Specific Parts for ECDH Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-algorithm-specific-part-for-ec">
* OpenPGP - Algorithm-Specific Parts for ECDSA Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-curve25519legacy-ecdh-secre">
* OpenPGP - Curve25519Legacy ECDH Secret Key Material (deprecated)</a>
*/
public class ECSecretBCPGKey
extends BCPGObject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

/**
* Public key of type {@link PublicKeyAlgorithmTags#Ed25519}.
* This type was introduced with Crypto-Refresh and can be used with v4, v6 keys.
* This type was introduced with RFC9580 and can be used with v4, v6 keys.
* Note however, that legacy implementations might not understand this key type yet.
* For a key type compatible with legacy v4 implementations, see {@link EdDSAPublicBCPGKey} with
* {@link PublicKeyAlgorithmTags#EDDSA_LEGACY}.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-algorithm-specific-part-for-ed2">
* Crypto-Refresh - Algorithm-Specific Part for Ed25519 Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-algorithm-specific-part-for-ed2">
* OpenPGP - Algorithm-Specific Part for Ed25519 Keys</a>
*/
public class Ed25519PublicBCPGKey
extends OctetArrayBCPGKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

/**
* Secret key of type {@link PublicKeyAlgorithmTags#Ed25519}.
* This type was introduced with Crypto-Refresh and can be used with v4, v6 keys.
* This type was introduced with RFC9580 and can be used with v4, v6 keys.
* Note however, that legacy implementations might not understand this key type yet.
* For a key type compatible with legacy v4 implementations, see {@link EdDSAPublicBCPGKey} with
* {@link PublicKeyAlgorithmTags#EDDSA_LEGACY}.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-algorithm-specific-part-for-ed2">
* Crypto-Refresh - Algorithm-Specific Part for Ed25519 Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-algorithm-specific-part-for-ed2">
* OpenPGP - Algorithm-Specific Part for Ed25519 Keys</a>
*/
public class Ed25519SecretBCPGKey
extends OctetArrayBCPGKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

/**
* Public key of type {@link PublicKeyAlgorithmTags#Ed448}.
* This type was introduced with Crypto-Refresh and can be used with v4, v6 keys.
* This type was introduced with RFC9580 and can be used with v4, v6 keys.
* Note however, that legacy implementations might not understand this key type yet.
* For a key type compatible with legacy v4 implementations, see {@link EdDSAPublicBCPGKey} with
* {@link PublicKeyAlgorithmTags#EDDSA_LEGACY}.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-algorithm-specific-part-for-ed4">
* Crypto-Refresh - Algorithm-Specific Part for Ed448 Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-algorithm-specific-part-for-ed4">
* OpenPGP - Algorithm-Specific Part for Ed448 Keys</a>
*/
public class Ed448PublicBCPGKey
extends OctetArrayBCPGKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

/**
* Secret key of type {@link PublicKeyAlgorithmTags#Ed448}.
* This type was introduced with Crypto-Refresh and can be used with v4, v6 keys.
* This type was introduced with RFC9580 and can be used with v4, v6 keys.
* Note however, that legacy implementations might not understand this key type yet.
* For a key type compatible with legacy v4 implementations, see {@link EdDSAPublicBCPGKey} with
* {@link PublicKeyAlgorithmTags#EDDSA_LEGACY}.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-algorithm-specific-part-for-ed4">
* Crypto-Refresh - Algorithm-Specific Part for Ed448 Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-algorithm-specific-part-for-ed4">
* OpenPGP - Algorithm-Specific Part for Ed448 Keys</a>
*/
public class Ed448SecretBCPGKey
extends OctetArrayBCPGKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* Modern OpenPGP uses dedicated key types:
* For {@link PublicKeyAlgorithmTags#Ed25519} see {@link Ed25519PublicBCPGKey} instead.
* For {@link PublicKeyAlgorithmTags#Ed448} see {@link Ed448PublicBCPGKey} instead.
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-algorithm-specific-part-for-ed">
* Crypto-Refresh - Algorithm-Specific Parts for EdDSALegacy Keys (deprecated)</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-algorithm-specific-part-for-ed">
* OpenPGP - Algorithm-Specific Parts for EdDSALegacy Keys (deprecated)</a>
*/
public class EdDSAPublicBCPGKey
extends ECPublicBCPGKey
Expand Down
4 changes: 2 additions & 2 deletions pg/src/main/java/org/bouncycastle/bcpg/EdSecretBCPGKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* For {@link PublicKeyAlgorithmTags#Ed25519} see {@link Ed25519SecretBCPGKey} instead.
* For {@link PublicKeyAlgorithmTags#Ed448} see {@link Ed448SecretBCPGKey} instead.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-algorithm-specific-part-for-ed">
* Crypto-Refresh - Algorithm-Specific Parts for EdDSALegacy Keys (deprecated)</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-algorithm-specific-part-for-ed">
* OpenPGP - Algorithm-Specific Parts for EdDSALegacy Keys (deprecated)</a>
*/
public class EdSecretBCPGKey
extends BCPGObject
Expand Down
6 changes: 3 additions & 3 deletions pg/src/main/java/org/bouncycastle/bcpg/HashAlgorithmTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* @see <a href="https://www.rfc-editor.org/rfc/rfc4880.html#section-9.4">
* RFC4880 - Hash Algorithms</a>
* @see <a href="https://www.ietf.org/archive/id/draft-koch-librepgp-00.html#name-hash-algorithms">
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-hash-algorithms">
* RFC9580 - Hash Algorithms</a>
* @see <a href="https://www.ietf.org/archive/id/draft-koch-librepgp-01.html#name-hash-algorithms">
* LibrePGP - Hash Algorithms</a>
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-hash-algorithms">
* Crypto-Refresh - Hash Algorithms</a>
*/
public interface HashAlgorithmTags
{
Expand Down
4 changes: 2 additions & 2 deletions pg/src/main/java/org/bouncycastle/bcpg/HashUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ public class HashUtils
/**
* Return the length of the salt per hash algorithm, used in OpenPGP v6 signatures.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#hash-algorithms-registry">
* Salt Size declarations</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#hash-algorithms-registry">
* OpenPGP - Salt Size declarations</a>
* @param hashAlgorithm hash algorithm tag
* @return size of the salt for the given hash algorithm in bytes
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
*
* @see <a href="https://www.rfc-editor.org/rfc/rfc4880.html#section-5.4">
* Definition of version 3 OPS packets in RFC4880</a>
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-one-pass-signature-packet-t">
* Definition of version 3 and 6 OPS packets in crypto-refresh</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-one-pass-signature-packet-t">
* Definition of version 3 and 6 OPS packets in RFC9580</a>
* @see <a href="https://www.ietf.org/archive/id/draft-koch-librepgp-00.html#section-5.4">
* Definition of version 3 and 6 OPS packets in librepgp</a>
*/
Expand Down
4 changes: 2 additions & 2 deletions pg/src/main/java/org/bouncycastle/bcpg/Packet.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public boolean hasNewPacketFormat()
* Tags 40 to 59 are reserved for unassigned, non-critical packets.
* Tags 60 to 63 are non-critical private or experimental packets.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-09.html#name-packet-tags">
* Packet Tags</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-packet-tags">
* OpenPGP - Packet Tags</a>
* @return true if the packet is critical, false otherwise.
*/
public boolean isCritical()
Expand Down
2 changes: 1 addition & 1 deletion pg/src/main/java/org/bouncycastle/bcpg/PacketFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* OpenPGP Packet Header Length Format.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-packet-headers">
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-packet-headers">
* OpenPGP Packet Headers</a>
*/
public enum PacketFormat
Expand Down
Loading

0 comments on commit a8380ae

Please sign in to comment.