Class: TCCE::Certificate
- Inherits:
-
Object
- Object
- TCCE::Certificate
- Defined in:
- lib/tcce/certificate.rb
Instance Attribute Summary collapse
-
#json ⇒ Object
Returns the value of attribute json.
Class Method Summary collapse
-
.parse(content) ⇒ Object
def to_s JSON.pretty_generate json end.
Instance Method Summary collapse
Instance Attribute Details
#json ⇒ Object
Returns the value of attribute json.
6 7 8 |
# File 'lib/tcce/certificate.rb', line 6 def json @json end |
Class Method Details
.parse(content) ⇒ Object
def to_s
JSON.pretty_generate json
end
12 13 14 15 16 |
# File 'lib/tcce/certificate.rb', line 12 def self.parse(content) file = TCCE::Certificate.new file.json = content file end |
Instance Method Details
#certificate ⇒ Object
26 27 28 29 |
# File 'lib/tcce/certificate.rb', line 26 def certificate certificate = Base64.decode64 json['Certificate']['Certificate'] OpenSSL::X509::Certificate.new certificate end |
#domain ⇒ Object
18 19 20 |
# File 'lib/tcce/certificate.rb', line 18 def domain json['Domains']['Main'] end |
#private_key ⇒ Object
31 32 33 34 |
# File 'lib/tcce/certificate.rb', line 31 def private_key private_key = Base64.decode64 json['Certificate']['PrivateKey'] OpenSSL::PKey::RSA.new private_key end |
#sans ⇒ Object
22 23 24 |
# File 'lib/tcce/certificate.rb', line 22 def sans json['Domains']['SANs'] end |