Class: EaSSL::CertificateAuthority

Inherits:
Object
  • Object
show all
Defined in:
lib/eassl/certificate_authority.rb

Overview

Author

Paul Nicholson ([email protected])

Co-Author

Adam Williams ([email protected])

Copyright

Copyright © 2006 WebPower Design

License

Distributes under the same terms as Ruby

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ CertificateAuthority

Returns a new instance of CertificateAuthority.



10
11
12
13
# File 'lib/eassl/certificate_authority.rb', line 10

def initialize(options = {})
  @key = Key.new({:password => 'ca_ssl_password'}.update(options))
  @certificate = AuthorityCertificate.new(:key => @key)
end

Instance Attribute Details

#certificateObject (readonly)

Returns the value of attribute certificate.



9
10
11
# File 'lib/eassl/certificate_authority.rb', line 9

def certificate
  @certificate
end

#keyObject (readonly)

Returns the value of attribute key.



9
10
11
# File 'lib/eassl/certificate_authority.rb', line 9

def key
  @key
end

Instance Method Details

#create_certificate(signing_request) ⇒ Object



15
16
17
18
19
# File 'lib/eassl/certificate_authority.rb', line 15

def create_certificate(signing_request)
  cert = Certificate.new(:signing_request => signing_request, :ca_certificate => @certificate)
  cert.sign(@key)
  cert
end