Class: SatMx::XmlAuthBody
- Inherits:
-
Object
- Object
- SatMx::XmlAuthBody
- Defined in:
- lib/sat_mx/bulk_download.rb
Instance Method Summary collapse
-
#initialize(certificate:, private_key:, id: "uuid-#{SecureRandom.uuid}-1") ⇒ XmlAuthBody
constructor
A new instance of XmlAuthBody.
- #sign ⇒ Object
Constructor Details
#initialize(certificate:, private_key:, id: "uuid-#{SecureRandom.uuid}-1") ⇒ XmlAuthBody
Returns a new instance of XmlAuthBody.
52 53 54 55 56 |
# File 'lib/sat_mx/bulk_download.rb', line 52 def initialize(certificate:, private_key:, id: "uuid-#{SecureRandom.uuid}-1") @certificate = certificate @private_key = private_key @id = id end |
Instance Method Details
#sign ⇒ Object
58 59 60 61 62 |
# File 'lib/sat_mx/bulk_download.rb', line 58 def sign Xmldsig::SignedDocument.new(xml_document).sign do |data| private_key.sign(OpenSSL::Digest.new("SHA1"), data) end end |