Class: Bullion::Models::Account

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/bullion/models/account.rb

Overview

ACMEv2 Account model

Instance Method Summary collapse

Instance Method Details

#generate_public_key_hashObject



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

#kidObject



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. = self
  order.status = "pending"
  order.identifiers = identifiers
  order.save

  order.prep_authorizations!

  order
end