Class OpenPGPDetachedSignatureGenerator


public class OpenPGPDetachedSignatureGenerator extends AbstractOpenPGPDocumentSignatureGenerator<OpenPGPDetachedSignatureGenerator>
High-Level OpenPGP Signature Generator for Detached Signatures. Detached signatures can be stored and distributed as a distinct object alongside the signed data. They are used for example to sign Release files of some Linux software distributions.

To use this class, instantiate it, optionally providing a concrete OpenPGPImplementation and OpenPGPPolicy for algorithm policing. Then, add the desired OpenPGPKey you want to use for signing the data via one or more calls to AbstractOpenPGPDocumentSignatureGenerator.addSigningKey(OpenPGPKey, KeyPassphraseProvider). You have fine-grained control over the signature by using the method AbstractOpenPGPDocumentSignatureGenerator.addSigningKey(OpenPGPKey.OpenPGPSecretKey, char[], SignatureParameters.Callback). Lastly, retrieve a list of detached signatures by calling sign(InputStream), passing in an InputStream containing the data you want to sign.