Class: Bullion::Models::Account
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Bullion::Models::Account
- Defined in:
- lib/bullion/models/account.rb
Overview
ACMEv2 Account model
Instance Method Summary collapse
- #generate_public_key_hash ⇒ Object
- #kid ⇒ Object
- #start_order(identifiers:, not_before: nil, not_after: nil) ⇒ Object
Instance Method Details
#generate_public_key_hash ⇒ Object
16 17 18 19 |
# File 'lib/bullion/models/account.rb', line 16 def generate_public_key_hash digest = Digest::SHA256.base64digest(public_key.to_json) self.public_key_hash = digest end |
#kid ⇒ Object
21 22 23 |
# File 'lib/bullion/models/account.rb', line 21 def kid id end |
#start_order(identifiers:, not_before: nil, not_after: nil) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/bullion/models/account.rb', line 25 def start_order(identifiers:, not_before: nil, not_after: nil) order = Order.new order.not_before = not_before if not_before order.not_after = not_after if not_after order.account = self order.status = "pending" order.identifiers = identifiers order.save order. order end |