![JAR search and dependency download from the Maven repository](/logo.png)
org.bouncycastle.openpgp.api.SignatureSubpacketsFunction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bcpg-jdk15to18 Show documentation
Show all versions of bcpg-jdk15to18 Show documentation
The Bouncy Castle Java API for handling the OpenPGP protocol. This jar contains the OpenPGP API for JDK 1.5 to JDK 1.8. The APIs can be used in conjunction with a JCE/JCA provider such as the one provided with the Bouncy Castle Cryptography APIs.
The newest version!
package org.bouncycastle.openpgp.api;
import org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator;
import org.bouncycastle.openpgp.PGPSignatureSubpacketVector;
/**
* Callback to modify the contents of a {@link PGPSignatureSubpacketGenerator}.
* The {@link OpenPGPV6KeyGenerator} already prepopulates the hashed subpacket areas of signatures during
* key generation. This callback is useful to apply custom changes to the hashed subpacket area during the
* generation process.
*/
@FunctionalInterface
public interface SignatureSubpacketsFunction
{
/**
* Apply some changes to the given {@link PGPSignatureSubpacketGenerator} and return the result.
* It is also possible to replace the whole {@link PGPSignatureSubpacketGenerator} by returning another instance.
* Tipp: In order to replace a subpacket, make sure to prevent duplicates by first removing subpackets
* of the same type using {@link PGPSignatureSubpacketGenerator#removePacketsOfType(int)}.
* To inspect the current contents of the generator, it is best to call
* {@link PGPSignatureSubpacketGenerator#generate()} and in turn inspect its contents using
* {@link PGPSignatureSubpacketVector#toArray()}.
*
* @param subpackets original subpackets
* @return non-null modified subpackets
*/
PGPSignatureSubpacketGenerator apply(PGPSignatureSubpacketGenerator subpackets);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy