Class: Mail::Gpg::DecryptedPart
- Inherits:
-
VerifiedPart
- Object
- Part
- VerifiedPart
- Mail::Gpg::DecryptedPart
- Defined in:
- lib/mail/gpg/decrypted_part.rb
Instance Method Summary collapse
-
#initialize(cipher_part, options = {}) ⇒ DecryptedPart
constructor
options are:.
Methods included from VerifyResultAttribute
#signature_valid?, #signatures, #verify_result, #verify_result=
Constructor Details
#initialize(cipher_part, options = {}) ⇒ DecryptedPart
options are:
:verify: decrypt and verify
9 10 11 12 13 14 15 16 17 |
# File 'lib/mail/gpg/decrypted_part.rb', line 9 def initialize(cipher_part, = {}) if cipher_part.mime_type != EncryptedPart::CONTENT_TYPE raise EncodingError, "RFC 3156 incorrect mime type for encrypted part '#{cipher_part.mime_type}'" end decrypted = GpgmeHelper.decrypt(cipher_part.body.decoded, ) self.verify_result = decrypted.verify_result if [:verify] super(decrypted) end |