File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
pg/src/main/java/org/bouncycastle/openpgp/api Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,13 @@ public class OpenPGPV6KeyGenerator
97
97
return subpackets ;
98
98
};
99
99
100
+ public static SignatureSubpacketsFunction ENCRYPTION_SUBKEY_SUBPACKETS = subpackets ->
101
+ {
102
+ subpackets .removePacketsOfType (SignatureSubpacketTags .KEY_FLAGS );
103
+ subpackets .setKeyFlags (true , KeyFlags .ENCRYPT_STORAGE | KeyFlags .ENCRYPT_COMMS );
104
+ return subpackets ;
105
+ };
106
+
100
107
public static SignatureSubpacketsFunction DIRECT_KEY_SIGNATURE_SUBPACKETS = subpackets ->
101
108
{
102
109
subpackets = DEFAULT_FEATURES .apply (subpackets );
@@ -685,9 +692,9 @@ public WithPrimaryKey addEncryptionSubkey(
685
692
}
686
693
// generate binding signature
687
694
PGPSignatureSubpacketGenerator subpackets = new PGPSignatureSubpacketGenerator ();
688
- subpackets .setKeyFlags (false , KeyFlags .ENCRYPT_STORAGE | KeyFlags .ENCRYPT_COMMS );
689
695
subpackets .setIssuerFingerprint (true , primaryKey .pair .getPublicKey ());
690
696
subpackets .setSignatureCreationTime (conf .keyCreationTime );
697
+ subpackets = ENCRYPTION_SUBKEY_SUBPACKETS .apply (subpackets );
691
698
692
699
// allow subpacket customization
693
700
if (bindingSubpacketsCallback != null )
You can’t perform that action at this time.
0 commit comments