File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
pg/src/main/java/org/bouncycastle/openpgp/api Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1
1
package org .bouncycastle .openpgp .api ;
2
2
3
3
import org .bouncycastle .openpgp .PGPSignatureSubpacketGenerator ;
4
+ import org .bouncycastle .openpgp .PGPSignatureSubpacketVector ;
4
5
5
6
/**
6
7
* Callback to modify the contents of a {@link PGPSignatureSubpacketGenerator}.
8
+ * The {@link OpenPGPV6KeyGenerator} already prepopulates the hashed subpacket areas of signatures during
9
+ * key generation. This callback is useful to apply custom changes to the hashed subpacket area during the
10
+ * generation process.
7
11
*/
8
12
@ FunctionalInterface
9
13
public interface SignatureSubpacketsFunction
10
14
{
11
15
/**
12
16
* Apply some changes to the given {@link PGPSignatureSubpacketGenerator} and return the result.
13
17
* It is also possible to replace the whole {@link PGPSignatureSubpacketGenerator} by returning another instance.
18
+ * Tipp: In order to replace a subpacket, make sure to prevent duplicates by first removing subpackets
19
+ * of the same type using {@link PGPSignatureSubpacketGenerator#removePacketsOfType(int)}.
20
+ * To inspect the current contents of the generator, it is best to call
21
+ * {@link PGPSignatureSubpacketGenerator#generate()} and in turn inspect its contents using
22
+ * {@link PGPSignatureSubpacketVector#toArray()}.
14
23
*
15
24
* @param subpackets original subpackets
16
- * @return modified subpackets
25
+ * @return non-null modified subpackets
17
26
*/
18
27
PGPSignatureSubpacketGenerator apply (PGPSignatureSubpacketGenerator subpackets );
19
28
}
You can’t perform that action at this time.
0 commit comments