Class: As2::Message
- Inherits:
-
Object
- Object
- As2::Message
- Defined in:
- lib/as2/message.rb
Instance Attribute Summary collapse
-
#original_message ⇒ Object
readonly
Returns the value of attribute original_message.
Instance Method Summary collapse
-
#attachment ⇒ Object
Return the attached file, use .filename and .body on the return value.
- #decrypted_message ⇒ Object
-
#initialize(message, private_key, public_certificate) ⇒ Message
constructor
A new instance of Message.
- #valid_signature?(partner_certificate) ⇒ Boolean
Constructor Details
#initialize(message, private_key, public_certificate) ⇒ Message
Returns a new instance of Message.
7 8 9 10 11 |
# File 'lib/as2/message.rb', line 7 def initialize(, private_key, public_certificate) @original_message = @private_key = private_key @public_certificate = public_certificate end |
Instance Attribute Details
#original_message ⇒ Object (readonly)
Returns the value of attribute original_message.
5 6 7 |
# File 'lib/as2/message.rb', line 5 def @original_message end |
Instance Method Details
#attachment ⇒ Object
Return the attached file, use .filename and .body on the return value
27 28 29 30 31 32 33 |
# File 'lib/as2/message.rb', line 27 def if mail. mail..find{|a| a.content_type == "application/edi-consent"} else mail end end |
#decrypted_message ⇒ Object
13 14 15 |
# File 'lib/as2/message.rb', line 13 def @decrypted_message ||= decrypt_smime() end |
#valid_signature?(partner_certificate) ⇒ Boolean
17 18 19 20 21 22 23 24 |
# File 'lib/as2/message.rb', line 17 def valid_signature?(partner_certificate) store = OpenSSL::X509::Store.new store.add_cert(partner_certificate) smime = Base64Helper.ensure_body_base64() = read_smime(smime) .verify [partner_certificate], store end |