Skip to content

Commit 7e59f96

Browse files
author
gefeili
committed
#1747 Document Signature Subpacket classes
2 parents d9e2c2e + 176731e commit 7e59f96

27 files changed

+230
-23
lines changed

pg/src/main/java/org/bouncycastle/bcpg/UserAttributeSubpacketTags.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22

33
/**
44
* Basic PGP user attribute sub-packet tag types.
5+
*
6+
* @see <a href="https://datatracker.ietf.org/doc/html/rfc4880#section-5.12">
7+
* RFC4880 - User Attribute Packet</a>
8+
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-user-attribute-packet-type-">
9+
* RFC9580 - User Attribute Packet</a>
510
*/
611
public interface UserAttributeSubpacketTags
712
{
13+
/**
14+
* Tag for an {@link org.bouncycastle.bcpg.attr.ImageAttribute}.
15+
*/
816
int IMAGE_ATTRIBUTE = 1;
917
}

pg/src/main/java/org/bouncycastle/bcpg/UserDataPacket.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package org.bouncycastle.bcpg;
22

3+
/**
4+
* Superclass for user identities ({@link UserIDPacket}, {@link UserAttributePacket}).
5+
* The superclass is used to hold different user identity objects in the same collection.
6+
*/
37
public interface UserDataPacket
48
{
59

pg/src/main/java/org/bouncycastle/bcpg/attr/ImageAttribute.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
import org.bouncycastle.bcpg.UserAttributeSubpacketTags;
88

99
/**
10-
* Basic type for a image attribute packet.
10+
* User-Attribute Subpacket used to encode an image, e.g. the user's avatar.
11+
*
12+
* @see <a href="https://datatracker.ietf.org/doc/html/rfc4880#section-5.12.1">
13+
* RFC4880 - Image Attribute Subpacket</a>
14+
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-the-image-attribute-subpack">
15+
* RFC9580 - Image Attribute Subpacket</a>
1116
*/
1217
public class ImageAttribute
1318
extends UserAttributeSubpacket

pg/src/main/java/org/bouncycastle/bcpg/sig/EmbeddedSignature.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@
44
import org.bouncycastle.bcpg.SignatureSubpacketTags;
55

66
/**
7-
* Packet embedded signature
7+
* Signature Subpacket for embedding one Signature into another.
8+
* This packet is used e.g. for embedding a primary-key binding signature
9+
* ({@link org.bouncycastle.openpgp.PGPSignature#PRIMARYKEY_BINDING}) into a subkey-binding signature
10+
* ({@link org.bouncycastle.openpgp.PGPSignature#SUBKEY_BINDING}) for a signing-capable subkey.
11+
*
12+
* @see <a href="https://datatracker.ietf.org/doc/html/rfc4880#section-5.2.3.26">
13+
* RFC4880 - Embedded Signature</a>
14+
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-embedded-signature">
15+
* RFC9580 - Embedded Signature</a>
816
*/
917
public class EmbeddedSignature
1018
extends SignatureSubpacket

pg/src/main/java/org/bouncycastle/bcpg/sig/Exportable.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
import org.bouncycastle.bcpg.SignatureSubpacketTags;
55

66
/**
7-
* packet giving signature creation time.
7+
* Signature Subpacket for marking a signature as exportable or non-exportable.
8+
* Non-exportable signatures are not intended to be published.
9+
*
10+
* @see <a href="https://datatracker.ietf.org/doc/html/rfc4880#section-5.2.3.11">
11+
* RFC4880 - Exportable Certification</a>
12+
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-exportable-certification">
13+
* RFC9580 - Exportable Certification</a>
814
*/
915
public class Exportable
1016
extends SignatureSubpacket

pg/src/main/java/org/bouncycastle/bcpg/sig/Features.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
import org.bouncycastle.bcpg.SignatureSubpacket;
44
import org.bouncycastle.bcpg.SignatureSubpacketTags;
55

6+
/**
7+
* Signature Subpacket encoding, which features are supported by the key-holders implementation.
8+
*
9+
* @see <a href="https://datatracker.ietf.org/doc/html/rfc4880#section-5.2.3.24">
10+
* RFC4880 - Features</a>
11+
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-features">
12+
* RFC9580 - Features</a>
13+
*/
614
public class Features
715
extends SignatureSubpacket
816
{

pg/src/main/java/org/bouncycastle/bcpg/sig/IntendedRecipientFingerprint.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
import org.bouncycastle.util.Arrays;
66

77
/**
8-
* packet giving the intended recipient fingerprint.
8+
* Signature Subpacket containing the fingerprint of the intended recipients primary key.
9+
* This packet can be used to prevent malicious forwarding/replay attacks.
10+
*
11+
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-intended-recipient-fingerpr">
12+
* RFC9580 - Intended Recipient Fingerprint</a>
913
*/
1014
public class IntendedRecipientFingerprint
1115
extends SignatureSubpacket

pg/src/main/java/org/bouncycastle/bcpg/sig/IssuerFingerprint.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
import org.bouncycastle.util.Arrays;
88

99
/**
10-
* packet giving the issuer key fingerprint.
10+
* Signature Subpacket containing the fingerprint of the issuers signing (sub-) key.
11+
* This packet supersedes the {@link IssuerKeyID} subpacket.
12+
*
13+
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-issuer-fingerprint">
14+
* RFC9580 - Issuer Fingerprint</a>
1115
*/
1216
public class IssuerFingerprint
1317
extends SignatureSubpacket

pg/src/main/java/org/bouncycastle/bcpg/sig/IssuerKeyID.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55
import org.bouncycastle.bcpg.SignatureSubpacketTags;
66

77
/**
8-
* packet giving the issuer key ID.
8+
* Signature Subpacket containing the key-id of the issuers signing (sub-) key.
9+
* If the version of that key is greater than 4, this subpacket MUST NOT be included in the signature.
10+
* For these keys, consider the {@link IssuerFingerprint} subpacket instead.
11+
*
12+
* @see <a href="https://datatracker.ietf.org/doc/html/rfc4880#section-5.2.3.5">
13+
* RFC4880 - Issuer</a>
14+
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-issuer-key-id">
15+
* RFC9580 - Issuer Key ID</a>
916
*/
1017
public class IssuerKeyID
1118
extends SignatureSubpacket

pg/src/main/java/org/bouncycastle/bcpg/sig/KeyExpirationTime.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
import org.bouncycastle.bcpg.SignatureSubpacketTags;
55

66
/**
7-
* packet giving time after creation at which the key expires.
7+
* Signature Subpacket containing the number of seconds after the key's creation date, after which the key expires.
8+
* The special value of {@code 0} means that the key never expires.
9+
*
10+
* @see <a href="https://datatracker.ietf.org/doc/html/rfc4880#section-5.2.3.6">
11+
* RFC4880 - Key Expiration Time</a>
12+
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-key-expiration-time">
13+
* RFC9580 - Key Expiration Time</a>
814
*/
915
public class KeyExpirationTime
1016
extends SignatureSubpacket

0 commit comments

Comments
 (0)