Method: EaSSL::CertificateAuthority#initialize

Defined in:
lib/eassl/certificate_authority.rb

#initialize(options = {}) ⇒ CertificateAuthority

Returns a new instance of CertificateAuthority.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/eassl/certificate_authority.rb', line 10

def initialize(options = {})
  if options[:key] && options[:certificate] && options[:serial]
    @key = options[:key]
    @certificate = options[:certificate]
    @serial = options[:serial]
  else
    options[:name] ||= {}
    @key = Key.new({:password => 'ca_ssl_password'}.update(options))
    @certificate = AuthorityCertificate.new(:key => @key, :name => options[:name])
    @serial = Serial.new(:next => 1)
  end
end