Râu Cao 9cc4108191
All checks were successful
continuous-integration/drone/push Build is passing
WIP Encrypt outgoing emails when possible
2024-09-26 23:14:22 +02:00

20 lines
329 B
Ruby

require 'gpgme'
module UserManager
class PgpEncrypt < UserManagerService
def initialize(user:, text:)
@user = user
@text = text
end
def call
crypto = GPGME::Crypto.new
crypto.encrypt(
@text,
recipients: @user.gnupg_key,
always_trust: true
)
end
end
end