Skip to content

Commit cba9a15

Browse files
committed
PGPSecretKey: Document the necessity to manually add direct-key sigs on v6 keys
1 parent 727e864 commit cba9a15

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

pg/src/main/java/org/bouncycastle/openpgp/PGPSecretKey.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,11 @@ private static SecretKeyPacket generateSecretKeyPacket(boolean isMasterKey, Publ
221221

222222
/**
223223
* Construct a PGPSecretKey using the passed in private/public key pair and binding it to the passed in id
224-
* using a generated certification of certificationLevel.The secret key checksum is calculated using the original
224+
* using a generated certification of certificationLevel. The secret key checksum is calculated using the original
225225
* non-digest based checksum.
226+
* <p>
227+
* Note: In case of a version 6 OpenPGP key, you need to manually add a direct-key self-signature on the primary
228+
* key in order for it to be considered valid.
226229
*
227230
* @param certificationLevel the type of certification to be added.
228231
* @param keyPair the public/private keys to use.
@@ -345,6 +348,9 @@ else if (!hashedPcks.hasSubpacket(SignatureSubpacketTags.EMBEDDED_SIGNATURE))
345348
/**
346349
* Construct a PGPSecretKey using the passed in private/public key pair and binding it to the passed in id
347350
* using a generated certification of certificationLevel.
351+
* <p>
352+
* Note: In case of a version 6 OpenPGP key, you need to manually add a direct-key self-signature on the primary
353+
* key in order for it to be considered valid.
348354
*
349355
* @param certificationLevel the type of certification to be added.
350356
* @param keyPair the public/private keys to use.

0 commit comments

Comments
 (0)