Skip to content

Commit 12d4b17

Browse files
committed
Javadoc
1 parent 9e78072 commit 12d4b17

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
11
package org.bouncycastle.openpgp.api;
22

33
import org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator;
4+
import org.bouncycastle.openpgp.PGPSignatureSubpacketVector;
45

56
/**
67
* 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.
711
*/
812
@FunctionalInterface
913
public interface SignatureSubpacketsFunction
1014
{
1115
/**
1216
* Apply some changes to the given {@link PGPSignatureSubpacketGenerator} and return the result.
1317
* 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()}.
1423
*
1524
* @param subpackets original subpackets
16-
* @return modified subpackets
25+
* @return non-null modified subpackets
1726
*/
1827
PGPSignatureSubpacketGenerator apply(PGPSignatureSubpacketGenerator subpackets);
1928
}

0 commit comments

Comments
 (0)