

If it is present, only key material from there (either given as key data likeĪbove, or as key id, key fingerprint or GPGMe::Key object if they have been

Note: Mail-Gpg in version 0.4 and up is more strict regarding the keys option: In theory you only need to specify the key once like that, however doing itĮvery time does not hurt as gpg is clever enough to recognize known keys, only The key will then be imported before actually trying to encrypt/send the mail. If you collect public key data from your users, you can specify the asciiĪrmored key data for recipients using the :keys option like this: You will get errors in case encryption is not possible due to missing keys. Make sure all recipients' public keys are present in your local gpg keychain.

gpg encrypt: true, sign_as:, passphrase_callback: -> ( obj, uid_hint, passphrase_info, prev_was_bad, fd ) end. new do to from subject 'gpg test' body "encrypt me!" add_file "some_attachment.zip" # encrypt message, no signing gpg encrypt: true # encrypt and sign message with sender's private key, using the given # passphrase to decrypt the key gpg encrypt: true, sign: true, password: 'secret' # encrypt and sign message using a different key gpg encrypt: true, sign_as:, password: 'secret' # encrypt and sign message and use a callback function to provide the # passphrase.
