J'ai utilisé le module suivantComment est-ce que je pourrais chiffrer un chemin de fichier avec ruby-gpgme?
https://github.com/ueno/ruby-gpgme
et ma base de code de cryptage est quelque chose comme ceci:
def encrypt_sign(
plaintext,
recipient_pubkey,
sender_privkey,
binary: nil,
password: nil
)
in_a_directory(binary) do
options = pinentry_mode(password)
GPGME::Ctx.new(options) do |ctx|
import(sender_privkey)
import(recipient_pubkey)
ctx.add_signer(*(find(sender_privkey, :secret)))
ctx.encrypt_sign(
find(recipient_pubkey, :public),
data(plaintext),
data,
GPGME::ENCRYPT_ALWAYS_TRUST
).to_s
end
end
end
Je ne sais pas comment le chemin du fichier d'entrée au lieu de fichier texte brut.
tout conseil est apprécié.