Class OpenPGPMessageGenerator


public class OpenPGPMessageGenerator extends AbstractOpenPGPDocumentSignatureGenerator<OpenPGPMessageGenerator>
Generator for OpenPGP messages. This class can generate armored/unarmored, encrypted and/or signed OpenPGP message artifacts. By default, the generator will merely pack plaintext into an armored LiteralDataPacket. If however, the user provides one or more recipient certificates/keys (addEncryptionCertificate(OpenPGPCertificate) / addEncryptionCertificate(OpenPGPCertificate.OpenPGPComponentKey)) or message passphrases addEncryptionPassphrase(char[]), the message will be encrypted. The encryption mechanism is automatically decided, based on the provided recipient certificates, aiming to maximize interoperability. If the user provides one or more signing keys by calling AbstractOpenPGPDocumentSignatureGenerator.addSigningKey(OpenPGPKey) or AbstractOpenPGPDocumentSignatureGenerator.addSigningKey(OpenPGPKey.OpenPGPSecretKey, KeyPassphraseProvider, SignatureParameters.Callback), the message will be signed.