Class: Bullion::Models::OrderCsr
- Inherits:
-
Object
- Object
- Bullion::Models::OrderCsr
- Defined in:
- lib/bullion/models/order_csr.rb
Overview
Pseudo-model for ACMEv2 Order CSR
Instance Attribute Summary collapse
-
#csr ⇒ Object
readonly
Returns the value of attribute csr.
-
#order ⇒ Object
readonly
Returns the value of attribute order.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(order, csr) ⇒ OrderCsr
constructor
A new instance of OrderCsr.
Constructor Details
#initialize(order, csr) ⇒ OrderCsr
Returns a new instance of OrderCsr.
26 27 28 29 30 31 32 33 |
# File 'lib/bullion/models/order_csr.rb', line 26 def initialize(order, csr) @order = order.is_a?(Order) ? order : Order.find(order) @csr = if csr.is_a?(String) OpenSSL::X509::Request.new(csr) else csr end end |
Instance Attribute Details
#csr ⇒ Object (readonly)
Returns the value of attribute csr.
24 25 26 |
# File 'lib/bullion/models/order_csr.rb', line 24 def csr @csr end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
24 25 26 |
# File 'lib/bullion/models/order_csr.rb', line 24 def order @order end |
Class Method Details
.from_acme_request(order, raw_data) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/bullion/models/order_csr.rb', line 8 def from_acme_request(order, raw_data) decoded_data = Base64.urlsafe_decode64(raw_data) reencoded_data = Base64.encode64(decoded_data) csr_string = openssl_compat_csr(reencoded_data) new(order, csr_string) end |