lib/sup/crypto.rb in sup-0.21.0 vs lib/sup/crypto.rb in sup-0.22.0
- old
+ new
@@ -8,15 +8,15 @@
class CryptoManager
include Redwood::Singleton
class Error < StandardError; end
- OUTGOING_MESSAGE_OPERATIONS = OrderedHash.new(
- [:sign, "Sign"],
- [:sign_and_encrypt, "Sign and encrypt"],
- [:encrypt, "Encrypt only"]
- )
+ OUTGOING_MESSAGE_OPERATIONS = {
+ sign: "Sign",
+ sign_and_encrypt: "Sign and encrypt",
+ encrypt: "Encrypt only"
+ }
KEY_PATTERN = /(-----BEGIN PGP PUBLIC KEY BLOCK.*-----END PGP PUBLIC KEY BLOCK)/m
KEYSERVER_URL = "http://pool.sks-keyservers.net:11371/pks/lookup"
HookManager.register "gpg-options", <<EOS
@@ -465,18 +465,19 @@
case subkey.pubkey_algo
when GPGME::PK_RSA then "RSA "
when GPGME::PK_DSA then "DSA "
when GPGME::PK_ELG then "ElGamel "
when GPGME::PK_ELG_E then "ElGamel "
+ else "unknown key type (#{subkey.pubkey_algo}) "
end
end
# logic is:
# if gpgkey set for this account, then use that
# elsif only one account, then leave blank so gpg default will be user
# else set --local-user from_email_address
# NOTE: multiple signers doesn't seem to work with gpgme (2.0.2, 1.0.8)
- #
+ #
def gen_sign_user_opts from
account = AccountManager.account_for from
account ||= AccountManager.default_account
if !account.gpgkey.nil?
opts = {:signer => account.gpgkey}